:root {
  --paper: #EFF1F4;
  --grid: #E0E4EA;
  --surface: #F7F8FA;
  --hairline: #C9CFD8;
  --ink: #232B36;
  --ink-soft: #5C6675;
  --ink-faint: var(--ink-soft);
  --amber: #D98E2B;
  --goo: #D18500;
  --amber-glow: #F7E3BF;
  --amber-deep: #8F5A10;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 600;
}

h2 {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: 6px;
}

ul {
  padding-left: 20px;
  margin: 0 0 20px;
}

li + li {
  margin-top: 4px;
}

a {
  color: var(--amber-deep);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1px 5px;
}

.sheet {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.sheet.narrow {
  max-width: 480px;
}

.sheet > * + * {
  margin-top: 18px;
}

.muted {
  color: var(--ink-soft);
  font-size: 14.5px;
}

.keeping-as {
  color: var(--ink-soft);
  font-size: 14.5px;
}

.lede {
  font-size: 17px;
  max-width: 34em;
}

.band {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber-deep);
  background: var(--amber-glow);
  border: 1px solid var(--amber);
  border-radius: 7px;
  padding: 8px 12px;
}

.bar-slot { contain: paint; position: relative; overflow: hidden; isolation: isolate; }
.temp-head { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 12px; padding-inline-start: 16px; font: 14px/1.4 system-ui, sans-serif; background: #F6F7F9; color: #0B0C13; border-bottom: 1px solid #d9dce3; }
.temp-name { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.temp-head .time { white-space: nowrap; font: 12.5px/1 "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; color: #8F5A10; background: #F7E3BF; border-radius: 999px; padding: 5px 10px; }
@media (max-width: 559px) {
  .temp-head { grid-template-columns: auto minmax(0, 1fr); padding: 10px 0 0 12px; }
  .temp-name { grid-column: 1 / -1; white-space: normal; }
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.96 0.03 90 / 0.92);
  color: oklch(0.25 0.01 80);
  font-size: clamp(24px, 5vw, 44px);
  padding: 16px;
  text-align: center;
}

.drop-overlay[hidden] {
  display: none;
}

.drop-notice {
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1;
  text-decoration: none;
  border-radius: 7px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
  white-space: nowrap;
  color: var(--ink);
}

.btn-sm {
  font-size: 13px;
  padding: 8px 13px;
  border-radius: 6px;
}

.btn-primary {
  background: #E6A65B;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-primary:hover {
  background: var(--amber-glow);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn-ghost:hover {
  border-color: var(--ink-soft);
  background: var(--paper);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.url-row input {
  flex: 1 1 240px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 11px 12px;
}

.preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.private-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 18px 20px;
}

.private-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--amber-glow);
  color: var(--amber-deep);
}

.private-icon.solo {
  margin-bottom: 4px;
}

.private-text h2 {
  margin-bottom: 4px;
}

.private-text p {
  color: var(--ink-soft);
  font-size: 15px;
}

.private-text strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.private-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  font-size: 14.5px;
}

body:has(.frame) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.bar-host {
  flex: 0 0 auto;
}

.frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--paper);
}

.frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 559px) {
  .sheet {
    padding: 28px 16px 48px;
  }

  h1 {
    font-size: 24px;
  }

  .actions .btn-primary {
    width: 100%;
  }

  .private-card {
    padding: 16px;
  }
}
