/* ==========================================================================
   Saye telefon örneği (ana sayfa ve /saye). Telefonun içi her zaman
   uygulamanın kendi açık görünümüdür; çevresindeki bölüm koyu da olabilir.
   Davranış: js/saye-telefon.js
   ========================================================================== */
.sy-phone {
  --p-ink: #111113; --p-soft: #5E5E66; --p-line: #DCDCD5; --p-cobalt: #2448F0; --p-paper: #F5F5F2; --p-card: #FFFFFF; --p-night: #0C0C0E;
  position: relative; width: min(100%, 340px); aspect-ratio: 9 / 18.6; padding: 11px; border-radius: 52px;
  background: #1D1D22; box-shadow: inset 0 0 0 1px #34343B, 0 40px 80px -44px rgb(0 0 0 / .7), 0 0 0 1px #000;
  font-family: var(--sa-font); text-align: left;
}
:where(.sy-phone) button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sy-phone button:focus-visible { outline: 2px solid var(--p-cobalt); outline-offset: 2px; }
.sy-phone__screen {
  position: relative; height: 100%; overflow: hidden; border-radius: 42px; background: var(--p-paper); color: var(--p-ink);
  padding: 14px 16px 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.4;
}
.sy-phone__status { display: flex; justify-content: space-between; align-items: center; padding: 2px 14px 10px; font-size: 12px; font-weight: 600; }
.sy-phone__status i { width: 34px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--p-ink) 75%, rgb(17 17 19 / .25) 0); }
.sy-phone__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sy-phone__mark { width: 24px; height: 24px; color: var(--p-ink); }
.sy-phone__avatar { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--p-ink); color: var(--p-paper); font-size: 11px; font-weight: 600; }
.sy-phone__date { font-size: 11.5px; color: var(--p-soft); margin-bottom: 4px; }
.sy-phone__hello { font-size: 25px; line-height: 1.06; letter-spacing: -0.035em; font-weight: 500; margin-bottom: 16px; }
.sy-phone__hello em { font-style: normal; color: var(--p-cobalt); }
.sy-phone__label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.sy-phone__label span + span { color: var(--p-soft); font-weight: 400; font-size: 12px; }

.sy-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sy-view[hidden] { display: none; }
.sy-view__h { font-size: 25px; letter-spacing: -0.035em; font-weight: 500; margin: 6px 0 12px; }
.sy-view__k { font-size: 13px; font-weight: 500; margin: 14px 0 8px; }

/* Günün işi */
.sy-card { background: var(--p-card); border-radius: 18px 6px 18px 6px; overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.sy-card__media { position: relative; aspect-ratio: 1; overflow: hidden; background: #E9E2D6; }
.sy-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s var(--sa-ease), transform 1.1s var(--sa-ease), filter .6s var(--sa-ease); }
.sy-card__img:not(.sy-card__img--a) { opacity: 0; }
.sy-card:not([data-variant="a"]) .sy-card__img--a { opacity: 0; }
.sy-card[data-variant="b"] .sy-card__img--b, .sy-card[data-variant="c"] .sy-card__img--c, .sy-card[data-variant="d"] .sy-card__img--d { opacity: 1; }
.sy-card[data-variant="c"] .sy-card__thumb, .sy-card[data-variant="d"] .sy-card__thumb { opacity: 0; }
.sy-card.is-close .sy-card__img { transform: scale(1.22); transform-origin: 38% 64%; }
.sy-card.is-warm .sy-card__img { filter: sepia(.22) saturate(1.25) brightness(1.03); }
.sy-card.is-busy .sy-card__img { filter: blur(6px) saturate(.6); }
.sy-card__badge {
  position: absolute; left: 10px; top: 10px; padding: 6px 10px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .94);
  font-size: 10.5px; font-weight: 500; color: var(--p-soft); transition: background-color .2s;
}
.sy-card__badge b { color: var(--p-ink); font-weight: 600; text-decoration: underline; text-decoration-color: rgb(17 17 19 / .3); text-underline-offset: 2px; }
.sy-card__badge:hover { background: #fff; }
.sy-card__seg {
  position: absolute; left: 50%; bottom: 10px; translate: -50% 0; display: grid; grid-template-columns: 1fr 1fr; padding: 3px;
  border-radius: 999px; background: rgb(17 17 19 / .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.sy-card__seg button { position: relative; z-index: 1; white-space: nowrap; padding: 7px 14px; border: 0; background: none; border-radius: 999px; font-size: 11.5px; font-weight: 500; color: rgb(255 255 255 / .85); transition: color .3s var(--sa-ease); }
.sy-card__seg button[aria-pressed="true"] { color: var(--p-ink); }
.sy-card__thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: #fff; transition: translate .4s var(--sa-ease); }
.sy-card[data-variant="b"] .sy-card__thumb { translate: 100% 0; }
.sy-card__busy {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; font-size: 12px; font-weight: 500;
  background: rgb(12 12 14 / .35); opacity: 0; pointer-events: none; transition: opacity .35s var(--sa-ease);
}
.sy-card__busy i { width: 120px; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .3); overflow: hidden; }
.sy-card__busy b { display: block; height: 100%; width: 0; background: #fff; }
.sy-card.is-busy .sy-card__busy { opacity: 1; }
.sy-card.is-busy .sy-card__busy b { animation: syBar 1.8s var(--sa-ease) forwards; }
@keyframes syBar { to { width: 100%; } }
.sy-card__body { padding: 12px 12px 14px; display: grid; gap: 3px; }
.sy-card__t { font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em; }
.sy-card__s { font-size: 11.5px; color: var(--p-soft); min-height: 2.8em; }
.sy-card.is-picked .sy-card__s { color: #1C7A4A; }
.sy-card__acts { display: flex; gap: 6px; margin-top: 4px; }
.sy-card__btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border: 0; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; transition: background-color .2s, transform .15s; }
.sy-card__btn:active { transform: scale(.96); }
.sy-card__btn--pick { background: var(--p-cobalt); color: #fff; }
.sy-card__btn--pick:hover { background: #1B39C9; }
.sy-card.is-picked .sy-card__btn--pick { background: #1C7A4A; }
.sy-card__btn--saye { background: var(--p-ink); color: #fff; }
.sy-card__btn--saye:hover { background: #2A2A30; }
.sy-card__btn svg { width: 12px; height: 12px; fill: currentColor; }

/* Saye ile yazışma */
.sy-chat { display: grid; align-content: start; gap: 8px; overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 8px; scrollbar-width: none; }
.sy-msg { max-width: 86%; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; }
.sy-msg--saye { justify-self: start; background: var(--p-night); color: #F5F5F2; border-radius: 16px 16px 16px 4px; }
.sy-msg--you { justify-self: end; background: #fff; border-radius: 16px 16px 4px 16px; box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.sy-msg.is-typing { color: #9A9AA3; }
.sy-msg.is-typing::after { content: "…"; animation: syDots 1s steps(3) infinite; }
@keyframes syDots { 50% { opacity: .3; } }
.sy-ask { display: grid; gap: 6px; padding: 8px 0 92px; }
.sy-ask button { padding: 9px 12px; border: 1px solid var(--p-line); border-radius: 999px; background: #fff; font-size: 12px; text-align: left; transition: border-color .2s; }
.sy-ask button:hover { border-color: var(--p-ink); }
.sy-ask button:disabled { opacity: .4; cursor: default; border-color: var(--p-line); }

/* Hesap */
.sy-plan { padding: 14px; border-radius: 18px 6px 18px 6px; background: var(--p-night); color: #F5F5F2; display: grid; gap: 2px; }
.sy-plan__k { font-size: 11px; color: #9A9AA3; }
.sy-plan__n { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.sy-plan__v { font-size: 12px; color: #C9C9CF; }
.sy-plan__x { font-size: 12px; color: #7D93FF; margin-top: 4px; }
.sy-auto { display: grid; gap: 6px; padding-bottom: 92px; }
.sy-auto button { display: grid; gap: 2px; padding: 10px 12px 10px 34px; border: 1px solid var(--p-line); border-radius: 14px; background: #fff; text-align: left; position: relative; transition: border-color .2s; }
.sy-auto button::before { content: ""; position: absolute; left: 12px; top: 13px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--p-soft); }
.sy-auto button[aria-checked="true"] { border-color: var(--p-ink); }
.sy-auto button[aria-checked="true"]::before { border: 4px solid var(--p-cobalt); }
.sy-auto b { font-size: 12.5px; font-weight: 500; }
.sy-auto span { font-size: 11px; color: var(--p-soft); line-height: 1.35; }

/* Alt sayfa ve bildirim */
.sy-sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 5; display: grid; gap: 6px; padding: 16px 14px 14px;
  border-radius: 26px 26px 34px 34px; background: #fff; box-shadow: 0 -10px 40px -10px rgb(0 0 0 / .35);
  animation: sySheet .35s var(--sa-ease);
}
.sy-sheet[hidden] { display: none; }
@keyframes sySheet { from { translate: 0 30px; opacity: 0; } }
.sy-sheet__h { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.sy-sheet > button:not(.sy-sheet__x) { padding: 11px 12px; border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-paper); font-size: 12.5px; text-align: left; transition: border-color .2s; }
.sy-sheet > button:not(.sy-sheet__x):hover { border-color: var(--p-ink); }
.sy-sheet__x { padding: 10px; border: 0; background: none; font-size: 12.5px; color: var(--p-soft); }
.sy-times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sy-times button { padding: 11px 0; border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-paper); font-size: 13px; font-weight: 500; }
.sy-times button[aria-pressed="true"] { background: var(--p-ink); border-color: var(--p-ink); color: #fff; }
.sy-toast {
  position: absolute; left: 50%; bottom: 84px; z-index: 6; translate: -50% 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--p-night); color: #F5F5F2; font-size: 11.5px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .25s, translate .3s var(--sa-ease);
}
.sy-toast.is-on { opacity: 1; translate: -50% 0; }

/* Alt menü */
.sy-phone__tabs {
  position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 4; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 6px 6px 5px; border-radius: 999px; background: #fff; box-shadow: 0 6px 20px -8px rgb(0 0 0 / .25);
}
.sy-phone__tabs button { display: grid; justify-items: center; gap: 2px; min-height: 40px; padding: 4px 0 2px; border: 0; background: none; font-size: 9px; color: var(--p-soft); position: relative; }
.sy-phone__tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.sy-phone__tabs .is-on { color: var(--p-ink); }
.sy-phone__tabs .is-on:not(.sy-phone__s)::after { content: ""; position: absolute; bottom: -3px; width: 4px; height: 4px; border-radius: 50%; background: var(--p-cobalt); }
.sy-phone__tabs .is-soon { opacity: .45; }
.sy-phone__tabs .sy-phone__s { align-self: center; display: grid; place-items: center; width: 50px; height: 50px; margin: -20px auto 0; padding: 0; border-radius: 16px 5px 16px 5px; background: var(--p-ink); color: #fff; transition: transform .15s; }
.sy-phone__tabs .sy-phone__s.is-on::after { content: ""; position: absolute; bottom: -9px; width: 4px; height: 4px; border-radius: 50%; background: var(--p-cobalt); }
.sy-phone__tabs .sy-phone__s:active { transform: scale(.95); }
.sy-phone__tabs .sy-phone__s svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }

@media (max-width: 620px) {
  .sy-phone { width: min(100%, 320px); }
  .sy-phone__hello { font-size: 21px; margin-bottom: 12px; }
  .sy-phone__top { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .sy-card__img, .sy-card__thumb, .sy-toast { transition: none; }
  .sy-sheet { animation: none; }
  .sy-card.is-busy .sy-card__busy b { animation: none; width: 100%; }
}
