/* Süzgeç Gönder — mobil öncelikli gönderici.
   Süzgeç Posta ile aynı aile: aynı renk değerleri, sıcak kâğıt zemin, mürekkep metin,
   1px ayırıcılar (gölge yok), küçük köşe yarıçapı, IBM Plex + Newsreader.
   Telefonda farkı yalnızca ölçek: büyük konu alanı, başparmak bölgesinde tek ana düğme. */

:root {
  color-scheme: light dark;

  /* Süzgeç Posta ile aynı değerler (apps/mail/css/app.css) */
  --paper: #f5f3ee;
  --sheet: #faf9f5; /* posta: --paper-raised */
  --sunk: #eeebe3; /* posta: --paper-sunk */
  --select: #e6e1d5; /* posta: --paper-select */
  --ink: #1b1a17;
  --ink-2: #47443d;
  --ink-3: #6a665d;
  --line: #dcd6ca; /* posta: --rule */
  --line-2: #c6bfb1; /* posta: --rule-strong */

  --spam: #b3401f;
  --spam-ink: #8e3113;
  --spam-soft: #f8ede6; /* posta: --spam-tint */
  --spam-line: #e9cbbd;
  --safe: #3f6b4e;
  --safe-soft: #e5ece3;
  --safe-line: #b9cdbc;
  --arrive: #ece4cf; /* posta: yeni gelen iletinin vurgusu */

  --focus: #1b1a17;
  --btn: #1b1a17;
  --btn-press: #47443d;
  --btn-text: #f5f3ee;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;

  --radius: 6px;
  --radius-sm: 4px;
  --gutter: 16px;
  --dock-h: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161513;
    --sheet: #1a1916;
    --sunk: #1c1b18;
    --select: #2a2823;
    --ink: #ece8df;
    --ink-2: #bdb7aa;
    --ink-3: #969083;
    --line: #2e2c27;
    --line-2: #45413a;

    --spam: #e0734f;
    --spam-ink: #f0a284;
    --spam-soft: #221713;
    --spam-line: #4a2c21;
    --safe: #8fb698;
    --safe-soft: #1a251d;
    --safe-line: #34503b;
    --arrive: #2d2a20;

    --focus: #ece8df;
    --btn: #ece8df;
    --btn-press: #bdb7aa;
    --btn-text: #161513;
  }
}

/* ------------------------------------------------------------------ temel */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-bottom: calc(var(--dock-h) + 16px);
  scroll-padding-top: 12px;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--dock-h) + 24px);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.mono {
  font-family: var(--mono);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

body[data-view='pairing'] .skip-link {
  display: none;
}

.noscript {
  max-width: 520px;
  margin: 24px auto;
  padding: 0 var(--gutter);
}

/* ------------------------------------------------------------------ iskelet */

.shell {
  max-width: 520px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding-top: env(safe-area-inset-top);
}

/* Marka: Süzgeç Posta'daki ile aynı (işaret + Newsreader ad + mono alt ad). */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

.brand-mark {
  flex: none;
}

.brand-mark rect {
  fill: currentColor;
}

.brand-mark .brand-mark-accent {
  fill: var(--spam);
}

.brand-name {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
}

.brand-sub {
  align-self: flex-end;
  padding-bottom: 2px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.box-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--sheet);
}

.box-button:active {
  background: var(--select);
}

.box-button-label {
  font-size: 13px;
  color: var(--ink-3);
}

.box-button-code {
  font: 500 17px/1 var(--mono);
  letter-spacing: 0.12em;
}

.box-button-icon {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

/* Bağlantı ve posta kutusu durumu (Süzgeç Posta'daki nokta dili) */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
}

.signal-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--ink-3);
  background: transparent;
}

.signal[data-state='online'] .signal-dot,
.signal[data-state='open'] .signal-dot {
  border-color: var(--safe);
  background: var(--safe);
}

.signal[data-state='offline'] .signal-dot,
.signal[data-state='closed'] .signal-dot {
  border-color: var(--spam);
  border-radius: 1px;
}

.signal[data-state='unknown'] .signal-dot {
  border-style: dashed;
}

.signal[data-state='connecting'] .signal-dot {
  animation: blink 1.4s ease-in-out infinite;
}

.signal[data-state='offline'] {
  color: var(--ink);
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* ------------------------------------------------------------------ düğmeler */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
}

.button:active:not(:disabled) {
  background: var(--select);
}

.button:disabled {
  cursor: not-allowed;
  color: var(--ink-3);
  background: transparent;
  border-style: dashed;
}

.button-small {
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
}

.button-primary {
  min-height: 56px;
  font-size: 18px;
  font-weight: 600;
  background: var(--btn);
  color: var(--btn-text);
  border-color: var(--btn);
}

.button-primary:active:not(:disabled) {
  background: var(--btn-press);
  border-color: var(--btn-press);
}

.button-primary:disabled {
  background: var(--sunk);
  color: var(--ink-2);
  border-color: var(--line-2);
}

.button-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.button-quiet:active:not(:disabled) {
  background: var(--select);
  color: var(--ink);
}

.button-danger {
  color: var(--spam-ink);
  border-color: var(--spam-line);
}

/* ------------------------------------------------------------------ eşleşme */

.pairing {
  padding: 20px 0 40px;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}

.pairing-title {
  margin: 6px 0 10px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.012em;
}

.pairing-lead {
  margin: 0 0 26px;
  color: var(--ink-2);
  max-width: 38ch;
}

.code-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.code-input {
  display: block;
  width: 100%;
  padding: 12px 14px 10px;
  border: 1px solid var(--line-2);
  border-bottom: 3px solid var(--ink);
  border-radius: var(--radius-sm) var(--radius-sm) 2px 2px;
  background: var(--sheet);
  color: var(--ink);
  font: 500 38px/1.1 var(--mono);
  letter-spacing: 0.28em;
  caret-color: var(--spam);
}

.code-input::placeholder {
  color: var(--line-2);
  opacity: 1;
}

.code-input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.code-input[aria-invalid='true'] {
  border-bottom-color: var(--spam);
}

.code-slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr) auto;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}

.code-slot {
  height: 5px;
  border-radius: 1px;
  background: var(--line);
  transition: background-color 120ms ease;
}

.code-slot[data-state='filled'] {
  background: var(--ink);
}

.code-slot[data-state='invalid'] {
  background: var(--spam);
}

.code-slot-overflow {
  font: 500 12px/1 var(--mono);
  color: var(--spam-ink);
}

.code-feedback {
  min-height: 1.45em;
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}

.code-feedback[data-tone='error'] {
  color: var(--spam-ink);
}

.code-feedback[data-tone='ok'] {
  color: var(--safe);
  font-weight: 500;
}

.code-help {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}

.code-hint {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--line-2);
  background: var(--sheet);
  font-size: 15px;
  color: var(--ink-2);
}

.broker-choice {
  margin: 28px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.broker-choice legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.broker-options {
  display: grid;
  gap: 8px;
}

.broker-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  cursor: pointer;
}

.broker-option:has(.broker-radio:checked) {
  border-color: var(--ink);
  background: var(--paper);
}

.broker-radio {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--ink);
}

.broker-option-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.broker-option-name {
  font-weight: 600;
}

.broker-option-meta {
  font: 400 13px/1.3 var(--mono);
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.broker-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-3);
}

.pairing-actions {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

/* ------------------------------------------------------------------ bölümler */

.section {
  padding-top: 18px;
}

.section:focus {
  outline: none;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-height: 44px;
  margin-bottom: 4px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.count {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.section-meta {
  font-size: 13px;
  color: var(--ink-3);
}

.section-meta .mono {
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.section-note {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ hazır iletiler */

.preset-group + .preset-group {
  margin-top: 6px;
}

.preset-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.preset-group-title::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--ink-3);
}

.preset-group[data-kind='spam'] .preset-group-title::before {
  background: var(--spam);
}

.preset-group[data-kind='normal'] .preset-group-title::before {
  background: var(--safe);
}

.preset-group-title .count {
  font-size: 12px;
}

.preset-strip {
  display: flex;
  gap: 10px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 12px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.preset-item {
  flex: none;
  scroll-snap-align: start;
}

.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 226px;
  height: 100%;
  min-height: 118px;
  padding: 9px 12px 11px;
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--ink-3);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  color: var(--ink);
  text-align: left;
}

.preset-card[data-kind='spam'] {
  border-top-color: var(--spam);
}

.preset-card[data-kind='normal'] {
  border-top-color: var(--safe);
}

.preset-card:active {
  background: var(--select);
}

.preset-card:focus-visible {
  outline-offset: 1px;
}

.preset-card[aria-current='true'] {
  border-left-color: var(--ink);
  border-right-color: var(--ink);
  border-bottom-color: var(--ink);
  background: var(--paper);
}

.preset-tag {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.preset-card[data-kind='spam'] .preset-tag {
  color: var(--spam-ink);
}

.preset-card[data-kind='normal'] .preset-tag {
  color: var(--safe);
}

.preset-num {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--ink-3);
}

.preset-subject {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.28;
}

.preset-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-2);
}

.preset-current {
  display: none;
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.preset-card[aria-current='true'] .preset-current {
  display: block;
}

/* Sırayla gönderim */
.demo-run {
  margin: 0 0 12px;
  padding: 8px 12px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--sheet);
}

.demo-run-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.demo-text {
  margin: 0;
  font: 500 14px/1.35 var(--mono);
  font-variant-numeric: tabular-nums;
}

.demo-bar {
  height: 5px;
  margin-top: 6px;
  border-radius: 1px;
  background: var(--sunk);
  overflow: hidden;
}

.demo-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 300ms ease;
}

.demo-run[data-result='done'] .demo-bar-fill {
  background: var(--safe);
}

.demo-run[data-result='offline'] .demo-bar-fill,
.demo-run[data-result='cancelled'] .demo-bar-fill {
  background: var(--ink-3);
}

/* ------------------------------------------------------------------ form */

.sheet {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--sheet);
  overflow: hidden;
}

.sheet.is-filled {
  animation: sheet-filled 700ms ease-out;
}

@keyframes sheet-filled {
  from {
    background-color: var(--arrive);
  }
}

.field {
  position: relative;
  padding: 10px 14px 8px;
  border-top: 1px solid var(--line);
}

.field:first-child {
  border-top: 0;
}

/* Odak: alanın solunda 3px mürekkep çizgisi (gölge değil). */
.field::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background-color 120ms ease;
}

.field:focus-within::before {
  background: var(--ink);
}

.field:has(.input[aria-invalid='true'])::before {
  background: var(--spam);
}

.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-3);
}

.field:focus-within .field-label {
  color: var(--ink);
}

.field-count {
  font: 400 12px/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  white-space: nowrap;
}

.field-count[data-level='near'] {
  color: var(--ink);
}

.field-count[data-level='over'] {
  color: var(--spam-ink);
  font-weight: 500;
}

.input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 4px 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.input-name {
  font-weight: 500;
}

.input-address {
  font-family: var(--mono);
  font-size: 16px;
}

.input-subject {
  padding-top: 2px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.005em;
}

.input-body {
  min-height: 8.2em;
  resize: none;
  overflow: hidden;
  line-height: 1.5;
}

.input[aria-invalid='true'] {
  text-decoration: underline wavy var(--spam);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.input-subject[aria-invalid='true'],
.input-body[aria-invalid='true'] {
  text-decoration: none;
}

.limit-note {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--spam-line);
  background: var(--spam-soft);
  color: var(--ink);
  font-size: 14px;
}

@media (min-width: 500px) {
  .sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .field,
  .limit-note {
    grid-column: 1 / -1;
  }

  .field-sender {
    grid-column: auto;
  }

  .field-sender + .field-sender {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

/* ------------------------------------------------------------------ gönderilenler */

.empty {
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-2);
}

.sent-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.sent-list:empty {
  border-top: 0;
}

.sent-item {
  display: grid;
  gap: 6px;
  padding: 12px 0 13px;
  border-bottom: 1px solid var(--line);
}

.sent-item.is-new {
  animation: row-in 900ms ease-out;
}

@keyframes row-in {
  from {
    background-color: var(--arrive);
  }
}

.sent-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.sent-subject {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.sent-subject.is-untitled {
  font-weight: 400;
  font-style: italic;
  color: var(--ink-2);
}

.sent-time {
  flex: none;
  font: 400 13px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.sent-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  font-size: 14px;
}

.sent-status-text {
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

[data-tone='spam'] > .sent-state .sent-status-text,
[data-tone='error'] > .sent-state .sent-status-text {
  color: var(--spam);
}

[data-tone='safe'] > .sent-state .sent-status-text {
  color: var(--safe);
}

.sent-status-sub {
  color: var(--ink-3);
}

.sent-box {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 400 12px/1.4 var(--mono);
  color: var(--ink-3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.chip {
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  font-size: 13px;
  line-height: 1.25;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

[data-tone='spam'] > .chips .chip {
  border-color: var(--spam-line);
  background: var(--spam-soft);
  color: var(--ink);
}

[data-tone='safe'] > .chips .chip {
  border-color: var(--safe-line);
  background: var(--safe-soft);
  color: var(--ink);
}

.sent-hint {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* Hazır örnek veri setindeki etiketinden farklı klasöre düştü: yanlış sınıflandırma notu. */
.sent-hint[data-kind='mismatch'] {
  padding-left: 9px;
  border-left: 2px solid var(--ink-3);
  color: var(--ink);
}

/* Üç bölümlü iz: gönderildi → sunucu → posta kutusu */
.track {
  display: inline-flex;
  flex: none;
  gap: 3px;
  --track-fill: var(--ink-2);
}

.track i {
  width: 13px;
  height: 6px;
  border: 1px solid var(--line-2);
  border-radius: 1px;
  background: var(--sunk);
  transition: background-color 250ms ease, border-color 250ms ease;
}

.track[data-stage='1'] i:nth-child(-n + 1),
.track[data-stage='2'] i:nth-child(-n + 2),
.track[data-stage='3'] i {
  border-color: var(--track-fill);
  background: var(--track-fill);
}

[data-tone='spam'] .track {
  --track-fill: var(--spam);
}

[data-tone='safe'] .track {
  --track-fill: var(--safe);
}

[data-status='sending'] .track i:nth-child(2),
[data-status='sent'] .track i:nth-child(3) {
  animation: blink 1s ease-in-out infinite;
}

[data-status='noreceipt'] .track i:nth-child(3) {
  border-style: dashed;
  border-color: var(--ink-3);
  background: transparent;
}

[data-status='failed'] .track i:nth-child(1) {
  border-color: var(--spam);
  background: var(--spam);
}

/* ------------------------------------------------------------------ alt bilgi */

.footer {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

.footer p {
  margin: 0 0 4px;
}

/* ------------------------------------------------------------------ alt çubuk (başparmak bölgesi) */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 8px max(var(--gutter), env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
  background: var(--paper);
  border-top: 1px solid var(--line-2);
}

/* Ekran klavyesi görünür alanı düzeni küçültmeden kapatıyorsa (iOS Safari) sabit çubuk
   klavyenin arkasında / sayfanın ortasında kalmasın diye gizlenir (app.js: trackKeyboard). */
:root[data-keyboard='overlay'] .dock {
  display: none;
}

.dock-inner {
  display: grid;
  gap: 6px;
  max-width: 488px;
  margin: 0 auto;
}

.dock-line {
  min-height: 44px;
}

.dock-last {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 14px;
  text-align: left;
}

.dock-last:active {
  background: var(--select);
}

.dock-last-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

.dock-last-status {
  flex: none;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.dock-last[data-tone='spam'] .dock-last-status,
.dock-last[data-tone='error'] .dock-last-status {
  color: var(--spam);
}

.dock-last[data-tone='safe'] .dock-last-status {
  color: var(--safe);
}

.dock-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 14px;
  color: var(--ink);
}

.dock-notice-text {
  flex: 1;
  min-width: 0;
}

.dock-notice-action {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  font-size: 14px;
  font-weight: 600;
}

.dock-notice-action:active {
  background: var(--select);
}

.send-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--btn);
  border-radius: var(--radius);
  background: var(--btn);
  color: var(--btn-text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.send-button:active:not(:disabled) {
  background: var(--btn-press);
  border-color: var(--btn-press);
}

.send-label {
  flex: none;
}

.send-note {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font: 400 14px/1.2 var(--mono);
}

.send-icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-left: auto;
}

.send-button:disabled {
  cursor: not-allowed;
  background: var(--sunk);
  color: var(--ink-2);
  border: 1px dashed var(--line-2);
}

.send-button:disabled .send-icon {
  opacity: 0.45;
}

.send-button[data-reason='offline'] .send-note {
  color: var(--spam-ink);
}

.send-button[data-reason='sending'] {
  background: var(--btn);
  color: var(--btn-text);
  border: 1px solid var(--btn);
}

.send-button[data-reason='sending'] .send-icon {
  opacity: 1;
  animation: nudge 600ms ease-in-out infinite alternate;
}

.send-button[data-reason='sent'] {
  background: var(--safe-soft);
  color: var(--safe);
  border: 1px solid var(--safe-line);
}

.send-button[data-reason='sent'] .send-icon {
  opacity: 1;
}

@keyframes nudge {
  to {
    transform: translateX(4px);
  }
}

/* Kısa görünümde (Android'de klavye açıkken düzen küçülür) alt çubuk sadeleşir. */
@media (max-height: 520px) {
  .dock-line {
    display: none;
  }
}

/* ------------------------------------------------------------------ dar ekranlar */

/* 360px'te üst çubuk sığsın diye: önce düğmedeki "Kutu" etiketi (ekran okuyucu adı aria-label'da), çok dar ekranda alt marka. */
@media (max-width: 379px) {
  .box-button-label {
    display: none;
  }
}

@media (max-width: 339px) {
  .brand-sub {
    display: none;
  }
}

/* ------------------------------------------------------------------ hareket azaltma */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
