:root {
  --bg: #FBF6F0;
  --surface: #FFFFFF;
  --surface-2: #F4ECE3;
  --text: #3B3633;
  --muted: #8C847D;
  --line: #EDE3D8;
  --primary: #E8857A;
  --primary-soft: #FBE4DF;
  --sage: #5E9C85;
  --sage-soft: #E1F0E8;
  --danger: #CF6A5F;
  --shadow: 0 12px 32px rgba(120, 90, 60, .10);
  --chip-l: 93%;
  --chip-text-l: 36%;
  --chip-s: 75%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1D1A19;
    --surface: #282423;
    --surface-2: #322D2B;
    --text: #F2ECE6;
    --muted: #A79E96;
    --line: #3A3431;
    --primary: #EE958A;
    --primary-soft: #46302C;
    --sage: #8CC4AE;
    --sage-soft: #263830;
    --danger: #EE8A80;
    --shadow: 0 12px 32px rgba(0, 0, 0, .35);
    --chip-l: 24%;
    --chip-text-l: 80%;
    --chip-s: 28%;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
h2, h3, h4 { font-weight: 800; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.icon-btn .ic { width: 22px; height: 22px; }
.btn .ic { width: 18px; height: 18px; }

#app { max-width: 460px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px 20px; }
.logo { font-weight: 800; font-size: 23px; letter-spacing: -.03em; }
.logo span { color: var(--primary); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; transition: background .2s; }
.icon-btn:hover { background: var(--surface-2); }

#view { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 24px; }
#view.fixed { overflow: hidden; display: flex; flex-direction: column; }
#view.flush { overflow: hidden; display: flex; flex-direction: column; padding: 0; }

.tabbar { display: flex; gap: 6px; padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border-radius: 18px; font-size: 12px; font-weight: 700; color: var(--muted);
  position: relative; transition: background .25s, color .25s;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar button.active { color: var(--primary); background: var(--primary-soft); }
.badge {
  position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; display: grid; place-items: center;
}

/* Ortak parçalar */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  background: hsl(var(--h) var(--chip-s) var(--chip-l)); color: hsl(var(--h) 45% var(--chip-text-l));
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 22px; border-radius: 18px; font-weight: 800; font-size: 16px;
  transition: transform .15s, opacity .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { color: var(--muted); }
.btn.block { width: 100%; }
.btn.small { padding: 9px 14px; font-size: 14px; border-radius: 14px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.field {
  display: block; width: 100%; padding: 16px 18px; border-radius: 20px; border: 2px solid var(--line);
  background: var(--surface); font-size: 17px; line-height: 1.5; outline: none; resize: none; transition: border-color .2s;
}
.field:focus { border-color: var(--primary); }
.counter { font-size: 13px; color: var(--muted); text-align: right; margin-top: 8px; }
.crisis { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: var(--sage-soft); font-size: 15px; line-height: 1.5; }
.crisis .ic { width: 22px; height: 22px; margin-top: 1px; color: var(--sage); }
.filter-note { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; padding: 11px 14px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); font-size: 14px; font-weight: 700; line-height: 1.45; }
.filter-note .ic { width: 18px; height: 18px; margin-top: 1px; }
.empty { text-align: center; padding: 48px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { margin: 0; font-size: 24px; }
.empty p { margin: 0 0 10px; line-height: 1.55; max-width: 300px; }
.empty.small { padding: 32px 12px; }
.empty-art { width: 88px; height: 88px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty-art .ic { width: 40px; height: 40px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Kartlar */
.swipe { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.deck { position: relative; flex: 1; min-height: 300px; margin: 8px 0 34px; }
.card {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px;
  padding: 24px 22px 20px; border-radius: 30px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden; touch-action: none; user-select: none;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .4s;
}
.card[data-depth="0"] { cursor: grab; }
.card.dragging { cursor: grabbing; }
.card > * { transition: opacity .4s; }
.card[data-depth="1"] { transform: translateY(26px) scale(.94); }
.card[data-depth="2"] { transform: translateY(50px) scale(.88); }
.card[data-depth="1"] > *, .card[data-depth="2"] > * { opacity: 0; }
.card.static { position: relative; inset: auto; min-height: 280px; box-shadow: var(--shadow); animation: rise .35s ease; }
.card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h3 { margin: 6px 0 0; font-size: 24px; line-height: 1.25; }
.card p {
  margin: 0; flex: 1; font-size: 17px; line-height: 1.6; opacity: .85; overflow: hidden; white-space: pre-wrap;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.foot-info { display: inline-flex; align-items: center; gap: 6px; }
.card footer .ic { width: 15px; height: 15px; }
.report-btn { width: 36px; height: 36px; margin: -8px -10px -8px 0; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s; }
.report-btn:hover { background: var(--surface-2); color: var(--danger); }
.card footer .report-btn .ic { width: 17px; height: 17px; }
.reasons { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; }
.reason { padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); text-align: left; font-weight: 700; transition: border-color .2s, background .2s; }
.reason.on { border-color: var(--primary); background: var(--primary-soft); }
.tag { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--danger); font-size: 12px; font-weight: 700; }
.chip .ic { width: 15px; height: 15px; }
.ago { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stamp {
  position: absolute; top: 20px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
  font-weight: 800; font-size: 15px; pointer-events: none; box-shadow: var(--shadow);
}
.stamp.like { right: 18px; background: var(--sage); color: #fff; opacity: var(--like, 0); transform: rotate(6deg); }
.stamp.nope { left: 18px; background: var(--surface-2); color: var(--muted); opacity: var(--nope, 0); transform: rotate(-6deg); }
.card.static .stamp { display: none; }
.card.static p { -webkit-mask-image: none; mask-image: none; }
.actions { display: flex; justify-content: center; align-items: center; gap: 28px; }
.round {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--muted);
  transition: transform .15s;
}
.round:active { transform: scale(.9); }
.round.help { width: 74px; height: 74px; background: var(--primary); border: 0; color: #fff; }
.round .ic { width: 26px; height: 26px; }
.round.help .ic { width: 30px; height: 30px; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* Derdini yaz */
.write { display: flex; flex-direction: column; min-height: 100%; }
.progress { display: flex; gap: 6px; margin: 6px 0 24px; }
.progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); transition: background .4s; }
.progress i.on { background: var(--primary); }
.step { animation: rise .35s ease; }
.step h2 { font-size: 27px; margin: 0 0 6px; }
.lead { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.topic {
  display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 20px; text-align: left;
  background: var(--surface); border: 2px solid var(--line); font-weight: 700; font-size: 16px;
  transition: border-color .2s, background .2s, transform .15s;
}
.topic:active { transform: scale(.97); }
.topic span {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: hsl(var(--h) var(--chip-s) var(--chip-l)); color: hsl(var(--h) 45% var(--chip-text-l));
}
.topic .ic { width: 20px; height: 20px; }
.topic.on span { background: var(--surface); }
.topic.on { border-color: hsl(var(--h) 60% 65%); background: hsl(var(--h) var(--chip-s) var(--chip-l)); }
.step-nav { margin-top: auto; padding-top: 28px; display: flex; gap: 12px; }
.step-nav .next-step { flex: 1; }

/* Mesajlar */
.inbox h2 { font-size: 27px; margin: 6px 0 16px; }
.convos, .mine { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.convo {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 22px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s; animation: rise .3s ease;
}
.convo:active { transform: scale(.98); }
.convo.new { border-color: var(--primary); }
.avatar {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 16px; font-weight: 800; letter-spacing: .02em;
  background: hsl(var(--h) var(--chip-s) var(--chip-l)); color: hsl(var(--h) 45% var(--chip-text-l));
}
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.meta { flex: 1; min-width: 0; }
.meta .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dert-title, .last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dert-title { font-size: 13px; color: var(--muted); }
.last { font-size: 15px; margin-top: 2px; }
.dot { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.sub { font-size: 16px; margin: 30px 0 12px; color: var(--muted); }

/* Dertlerim */
.mine-item {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 22px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s; animation: rise .3s ease;
}
.mine-item:active { transform: scale(.98); }
.mine-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mine-item b { font-size: 17px; line-height: 1.3; }
.mine-item p, .advice p { margin: 0; line-height: 1.55; }
.mine-item p { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mine-foot { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.mine-foot .ic { width: 15px; height: 15px; }
.mine-foot .dot { margin-left: auto; }
.dert-detail .back-link { margin: 0 0 10px -12px; }
.dert-detail .card.static { min-height: 0; }
.advices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.advice {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 22px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s; animation: rise .3s ease;
}
.advice:active { transform: scale(.98); }
.advice-head { display: flex; align-items: center; gap: 10px; }
.advice-head b { flex: 1; }
.advice p { font-size: 15px; }
.advice-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--primary); }
.ic.flip { width: 15px; height: 15px; transform: scaleX(-1); }

/* Sohbet */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-head .who { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.chat-head .who span { font-size: 12px; }
.dert-peek { margin: 10px 14px 0; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); font-size: 14px; }
.dert-peek summary { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; list-style: none; }
.dert-peek summary span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dert-peek summary::-webkit-details-marker { display: none; }
.dert-peek p { margin: 10px 0 0; line-height: 1.55; color: var(--muted); white-space: pre-wrap; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 82%; padding: 11px 15px; border-radius: 22px; font-size: 15.5px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.bubble.fresh, .sys.fresh { animation: rise .3s ease; }
.bubble time { display: block; margin-top: 3px; font-size: 11px; opacity: .65; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 8px; }
.bubble.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 8px; }
.sys { align-self: center; max-width: 90%; padding: 7px 14px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); font-size: 13px; font-weight: 700; text-align: center; }
.typing { display: flex; gap: 5px; padding: 15px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.composer .crisis { margin: 0 0 10px; }
.status { display: flex; justify-content: center; margin-bottom: 10px; }
.pill { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.extend { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.input-row { display: flex; align-items: flex-end; gap: 8px; }
.input-row textarea {
  flex: 1; max-height: 120px; padding: 12px 16px; border-radius: 22px; border: 2px solid var(--line);
  background: var(--surface); font-size: 15.5px; line-height: 1.4; outline: none; resize: none;
}
.input-row textarea:focus { border-color: var(--primary); }
.input-row textarea:disabled { opacity: .55; }
.send-btn { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; transition: opacity .2s; }
.send-btn .ic { width: 20px; height: 20px; }
.send-btn:disabled { opacity: .35; }

/* Alt pencere */
#sheet-root .backdrop { position: fixed; inset: 0; z-index: 10; background: rgba(40, 30, 25, .35); opacity: 0; transition: opacity .26s; }
#sheet-root .sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 11; width: min(460px, 100%); max-height: 90dvh; overflow-y: auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: var(--bg);
  transform: translate(-50%, 100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
#sheet-root .sheet::before { content: ''; display: block; width: 40px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--line); }
#sheet-root.open .backdrop { opacity: 1; }
#sheet-root.open .sheet { transform: translate(-50%, 0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h3 { margin: 0; font-size: 21px; }
.sheet > p { line-height: 1.55; }
.sheet hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0 8px; }
.sheet h4 { margin: 14px 0 12px; }
.sheet .field + .btn { margin-top: 12px; }
.quote { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); }
.quote p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 8px 0 16px; font-size: 12px; color: var(--muted); }
.sheet .crisis { margin: 0 0 16px; }
.code {
  margin: 16px 0 12px; padding: 20px; border-radius: 20px; border: 2px dashed var(--primary); background: var(--surface);
  color: var(--primary); font-size: 20px; font-weight: 800; text-align: center; word-break: break-word;
}
.warn { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 0 16px; }
.dev { margin-top: 20px; font-size: 14px; color: var(--muted); }
.dev summary { cursor: pointer; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border-radius: 16px; text-align: left; font-weight: 700; transition: background .2s; }
.menu-item .ic { width: 20px; height: 20px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.welcome { text-align: center; padding: 8px 4px 0; }
.welcome h3 { margin: 6px 0 8px; font-size: 22px; }
.welcome p { line-height: 1.55; margin: 0 0 18px; }
.welcome ul { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.welcome li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.welcome li .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--primary); }

.consent {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); text-align: left; font-size: 14px; line-height: 1.5; cursor: pointer;
}
.consent input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--primary); }
.consent a, .legal-links a { color: var(--primary); font-weight: 700; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 20px 0 0; font-size: 13px; }

/* Aşağı çekip yenileme göstergesi. Tarayıcının kendi "çekince sayfayı yenile"si kapalı. */
html, body { overscroll-behavior-y: none; }
.pull {
  position: fixed; top: 0; left: 50%; z-index: 9; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--muted); box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, -50px); pointer-events: none;
  transition: transform .25s ease, opacity .2s, color .2s;
}
.pull.dragging { transition: color .2s; }
.pull.ready, .pull.spin { color: var(--primary); }
.pull .ic { width: 20px; height: 20px; }
.pull.spin { opacity: 1; }
.pull.spin .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Telefonda sohbet açıkken üst ve alt menü gizlenir */
body.in-chat .topbar, body.in-chat .tabbar { display: none; }
.side-foot { display: none; }
.convo.active { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Geniş ekran (masaüstü, yatay tablet) ---------- */
@media (min-width: 900px) {
  #app {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 256px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "top main" "nav main";
  }
  body.in-chat .topbar, body.in-chat .tabbar { display: flex; }

  .topbar { grid-area: top; padding: 30px 16px 22px 28px; border-right: 1px solid var(--line); }
  .logo { font-size: 26px; }
  .tabbar {
    grid-area: nav; flex-direction: column; gap: 4px; padding: 0 16px 24px;
    border-top: 0; border-right: 1px solid var(--line); background: transparent;
  }
  .tabbar button {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 13px 16px; border-radius: 16px; font-size: 16px;
  }
  .tabbar button:hover:not(.active) { background: var(--surface-2); color: var(--text); }
  .tabbar svg { width: 21px; height: 21px; }
  .badge { position: static; margin-left: auto; }
  .side-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 0 16px; font-size: 13px; }
  .side-foot a { color: var(--muted); text-decoration: none; }
  .side-foot a:hover { color: var(--primary); }

  #view { grid-area: main; padding: 36px 48px; }
  #view.fixed { padding-bottom: 40px; }

  /* Kartlar ortada, sabit boyda */
  .swipe { width: 100%; max-width: 440px; margin: 0 auto; }
  .deck { flex: 0 1 560px; }

  /* Dert yazma ortada dar bir sütunda */
  .write { max-width: 560px; margin: 0 auto; min-height: 0; }
  .step-nav { margin-top: 32px; }

  /* Dertlerim kart ızgarası, detay ortada */
  .inbox { max-width: 900px; margin: 0 auto; }
  .mine { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
  .dert-detail { max-width: 660px; margin: 0 auto; }

  /* Dertlerim'den açılan sohbet ortada bir sütun */
  #view.flush { padding: 0; }
  #view.flush .chat { width: 100%; max-width: 780px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

  /* Mesajlar: solda liste, sağda sohbet */
  #view.split { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; padding: 0; overflow: hidden; }
  #view.split .inbox-list { max-width: none; margin: 0; padding: 36px 20px; overflow-y: auto; border-right: 1px solid var(--line); }
  .chat-pane { display: flex; flex-direction: column; min-height: 0; }
  .chat-pane > .empty { margin: auto; }
  .chat-pane .back { display: none; }
  .chat-pane .chat-head { padding: 18px 20px; }
  .chat-pane .msgs { padding: 20px 24px; }
  .chat-pane .bubble { max-width: 70%; }

  /* Alttan açılan pencereler ortada kutu olarak açılır */
  #sheet-root .sheet {
    top: 50%; bottom: auto; width: min(500px, calc(100% - 32px)); max-height: 86vh;
    padding: 22px 26px 26px; border-radius: 28px; opacity: 0;
    transform: translate(-50%, -46%); transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s;
  }
  #sheet-root .sheet::before { display: none; }
  #sheet-root.open .sheet { opacity: 1; transform: translate(-50%, -50%); }

  .card h3 { font-size: 26px; }
}

#toast {
  position: fixed; left: 50%; top: 18px; z-index: 20; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 700; text-align: center; pointer-events: none;
  opacity: 0; transform: translate(-50%, -16px); transition: opacity .3s, transform .3s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
