/* A dedicated phone layout. Desktop styling stays in style.css. */
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: radial-gradient(ellipse 110% 360px at 100% 0, #202b1945, transparent 80%), var(--bg);
}
.mobile-label { display: inline; }
.desktop-label { display: none; }
.site-shell {
  padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
}
.header { height: 68px; border-color: #2b3326; }
.brand { font-size: 24px; letter-spacing: -1.1px; }
.brand-mark { gap: 3px; margin-right: 12px; }
.brand-mark b { width: 10px; }
.header-right { gap: 0; }
.help-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 13px;
  border: 1px solid #343d2d; border-radius: 24px;
  color: #c1cbb5; font-size: 12px;
}
.help-link span { margin: 0; }
.help-link span:first-child { color: inherit; }
.hero { padding: 24px 0 22px; display: block; }
.hero .eyebrow { font-size: 9px; letter-spacing: 1.05px; gap: 9px; line-height: 1.6; }
.tiny-signal { font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
.hero h1 {
  font-size: clamp(38px, 11.2vw, 62px); font-weight: 650;
  line-height: 1.06; letter-spacing: -2.5px; margin: 14px 0 12px;
}
.hero-copy > p { font-size: 14px; line-height: 1.55; color: #a7b29d; }
.signal-art { display: none; }

.translator {
  overflow: visible; background: none; border: 0;
  border-radius: 0; box-shadow: none;
}
.tool-top { display: block; padding: 0; border: 0; }
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; width: 100%;
  padding: 5px; border-radius: 15px; border-color: #35412d; background: #1a2016;
}
.mode {
  min-height: 48px; min-width: 0; justify-content: center; gap: 8px;
  padding: 11px 8px; border-radius: 10px; font-size: 14px;
  font-weight: 600; color: #a4af9a;
}
.mode.active {
  background: var(--accent); border-color: var(--accent);
  color: #1c2912; box-shadow: 0 2px 12px #050a0440;
}
.mode-symbol { font-size: 22px; }
.mode svg { width: 18px; height: 18px; }
.new-badge { font-size: 10px; border-color: #4b583d; padding: 2px 4px; white-space: nowrap; }
.mode.active .new-badge { color: #30451f; border-color: #718e4e; }
.tool-top-note { display: block; padding: 8px 4px 0; font-size: 11px; line-height: 1.5; color: #97a58a; }
.direction-bar { padding: 8px 3px; gap: 12px; }
.direction-switch { gap: 18px; }
.direction-switch button {
  position: relative; min-height: 44px; padding: 9px 0;
  font-size: 12px; font-weight: 500; color: #8e9d80;
}
.direction-switch .selected { color: #e7efdc; }
.direction-switch .selected::after {
  content: ''; position: absolute; bottom: 2px; left: 0; right: 0;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.text-button { min-height: 44px; padding: 8px 0 8px 8px; font-size: 12px; color: #b0bea3; }
.text-button span { margin-left: 0; }
.text-button > span:last-child { margin-left: 7px; color: var(--accent); }

.editors { display: flex; flex-direction: column; gap: 10px; }
.editor {
  padding: 12px 18px 13px; background: #191e16;
  border: 1px solid #35402e; border-radius: 17px;
}
.input-editor { transition: border-color .2s, box-shadow .2s; }
.input-editor:focus-within { border-color: #8daa68; box-shadow: 0 0 0 3px #d1fa840a; }
.output-editor { background: #1d2518; border-color: #3c4b31; }
.editor-label { height: 44px; font-size: 10px; letter-spacing: 1.35px; color: #a3b394; }
.icon-button { width: 44px; height: 44px; padding: 12px; border-radius: 10px; }
.icon-button svg { width: 17px; height: 17px; }
.input-editor .icon-button { margin-right: -10px; }
textarea {
  min-height: 96px; max-height: 240px; padding: 10px 0 12px;
  font: 400 20px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif;
  border-radius: 0; scrollbar-width: thin;
}
textarea:focus-visible { box-shadow: none; }
textarea::placeholder { font-size: 18px; line-height: 1.6; }
#output {
  min-height: 124px; max-height: 320px; font-size: 22px;
  line-height: 1.7; letter-spacing: 2px; padding-top: 10px;
}
#output.incognito, #input.incognito { font-size: 28px; line-height: 1.65; letter-spacing: 2px; }
#output.decoded { font: 400 20px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: 0; }
@supports (field-sizing: content) {
  textarea { field-sizing: content; }
}
.editor-meta { align-items: flex-end; min-height: 27px; gap: 12px; font-size: 10.5px; line-height: 1.6; color: #91a27f; }
.editor-meta span:last-child { font-size: 10px; }
.live-label { font-size: 9px; letter-spacing: 1px; color: #b6d29b; gap: 7px; }
.live-label i { width: 5px; height: 5px; box-shadow: 0 0 9px #d1fa8430; }
.swap-button {
  position: static; align-self: center; flex-shrink: 0;
  transform: rotate(90deg); width: 44px; height: 44px; margin: -4px 0;
  border-color: #46563a; background: #242f1d; color: #d1e2bd;
}
.swap-button svg { width: 19px; height: 19px; }

.tool-bottom {
  position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 4;
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px;
  padding: 10px; margin-top: 16px; border: 1px solid #3b4830;
  border-radius: 17px; background: #1b2316;
  box-shadow: 0 10px 32px #0006, 0 -6px 22px #10121060;
}
.audio-group { min-width: 0; display: block; }
.audio-bars { display: none; }
.audio-button {
  justify-content: center; gap: 8px; width: 100%; min-height: 48px;
  padding: 12px 8px; border-radius: 10px; font-size: 13px; color: #d2dfc6; border-color: #445338;
}
.audio-button svg { width: 17px; height: 17px; }
.copy-button { justify-content: center; min-height: 48px; padding: 12px; border-radius: 10px; font-size: 13px; gap: 8px; }
.copy-button svg { width: 17px; height: 17px; }
.copy-arrow { margin-left: auto; font-size: 19px; }
.feedback { margin-top: 12px; padding: 14px 16px; border: 1px solid #725d35; border-radius: 12px; font-size: 12px; }
.under-tool { display: block; margin: 18px 2px 0; font-size: 11px; line-height: 1.6; }
.under-tool > span:first-child { gap: 8px; }
.under-tool svg { width: 15px; height: 15px; }
.under-tool > span:last-child { display: none; }

.how { grid-template-columns: 1fr; padding: 33px 0 28px; gap: 25px; }
.step { gap: 15px; align-items: flex-start; }
.step-number { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; padding: 0; border: 1px solid #35402c; border-radius: 9px; font-size: 10px; color: #b5c7a2; }
.step h2 { font-size: 14px; margin: 1px 0 6px; }
.step p { font-size: 12px; line-height: 1.75; color: #97a58a; }
.step p br { display: none; }
.alphabet summary { min-height: 70px; padding: 17px 0; font-size: 13px; gap: 12px; }
.alphabet-summary-note { font-size: 10px; gap: 12px; }
.alphabet-summary-note b { font-size: 24px; }
.alphabet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-bottom: 24px; }
.alphabet-cell { min-height: 44px; align-items: center; padding: 10px; font-size: 12px; border-radius: 8px; }
.alphabet-cell span { letter-spacing: 1px; }
footer { display: grid; grid-template-columns: 1fr auto; height: auto; gap: 0 12px; padding: 18px 0 calc(25px + env(safe-area-inset-bottom)); font-size: 11px; }
.footer-brand { font-size: 14px; }
footer > span:nth-child(2) { grid-row: 2; grid-column: 1 / -1; font-size: 10.5px; }
footer button { grid-row: 1; grid-column: 2; min-height: 44px; font-size: 11px; }

dialog {
  width: calc(100% - 16px); max-height: calc(100dvh - 24px);
  margin: auto 8px 8px; padding: 34px 24px calc(24px + env(safe-area-inset-bottom));
  border-radius: 24px; overscroll-behavior: contain;
}
.dialog-close { top: 9px; right: 9px; font-size: 28px; }
dialog .eyebrow { font-size: 9px; }
dialog h2 { font-size: 27px; line-height: 1.15; padding-right: 12px; }
dialog p { font-size: 14px; line-height: 1.7; }
.dialog-note { font-size: 12px; line-height: 1.6; }
.dialog-ok { width: 100%; margin-top: 24px; }
.toast { bottom: calc(100px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 14px 18px; font-size: 13px; border-radius: 12px; }

/* Let the editor use the available space when the phone keyboard is open. */
@media (max-height: 600px) {
  .tool-bottom { position: static; }
}
@media (max-width: 374px) {
  .new-badge { display: none; }
}
@media (max-width: 359px) {
  .site-shell { padding-left: 16px; padding-right: 16px; }
  .hero .eyebrow { font-size: 8px; letter-spacing: .7px; }
  .hero h1 { font-size: 37px; letter-spacing: -2px; }
  .copy-arrow { display: none; }
  .direction-switch { gap: 14px; }
  .editor { padding-left: 15px; padding-right: 15px; }
  .editor-meta { font-size: 10px; gap: 8px; }
  .editor-meta span:last-child { font-size: 9px; }
  .alphabet-summary-note { font-size: 0; }
}
