@font-face { font-family: Instrument; src: url(/fonts/latin-ext.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20C0; }
@font-face { font-family: Instrument; src: url(/fonts/latin.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2190-2193; }

:root {
  --page: #f2f2f4; --surface: #fff; --sunken: #e9e9ed; --ink: #19141b; --soft: #645d68; --line: #d9d8de; --field: #8b8590;
  --wine: #7c1638; --wine-dark: #5c0d28; --wine-tint: #f5e9ed; --danger: #a8201a; --ok: #1c6b40; --note: #fbf0d0;
  --r: 8px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body:has(dialog[open]) { overflow: hidden; }
button, label, input, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1rem/1.5 Instrument, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 600; text-wrap: balance; }
h2 { font-size: 1.125rem; line-height: 1.3; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
.muted { color: var(--soft); font-size: .9375rem; }
.error { color: var(--danger); }
.error:empty { display: none; }
.note { background: var(--note); padding: .75rem 1rem; border-radius: var(--r); font-size: .9375rem; }
.sr { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
img { display: block; }

button, input, select { font: inherit; color: inherit; }
button { min-height: 2.75rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color .15s, border-color .15s; }
button:hover { border-color: var(--field); }
.plain { background: transparent; border-color: transparent; }
.plain:hover { background: var(--sunken); border-color: transparent; }
.danger { color: var(--danger); }
.primary { background: var(--wine); border-color: var(--wine); color: #fff; font-weight: 600; }
.primary:hover { background: var(--wine-dark); border-color: var(--wine-dark); }
.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button:disabled { opacity: .55; cursor: progress; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
h1:focus-visible, h2:focus-visible { outline: none; }
label { display: block; font-weight: 500; }
input:not([type=checkbox], [type=file]), select { width: 100%; min-height: 2.75rem; padding: 0 .75rem; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); }

/* Giriş */
.login { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.login-art { background: var(--wine); color: #fff; padding: 2rem 1.5rem; display: grid; gap: 1.5rem; }
.login-art svg { width: 100%; max-height: 24rem; color: #e7b9c8; display: none; }
.login-art h1 { font-size: 2.25rem; }
.login-art p { color: #f3dbe3; }
.login form { display: grid; gap: .5rem; align-content: center; width: min(24rem, 100%); margin: 0 auto; padding: 2rem 1.5rem; }
.login form h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.login .primary { margin-top: .5rem; }

/* Çerçeve */
.bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .5rem; height: 4rem; padding: 0 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { margin-right: auto; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; color: var(--wine); }
#closet { display: grid; grid-template-columns: minmax(0, 1fr); }
.side { position: sticky; top: 4rem; z-index: 1; display: flex; gap: .25rem; overflow-x: auto; padding: .5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.side button { display: flex; justify-content: space-between; gap: .75rem; align-items: center; flex: none; background: transparent; border-color: transparent; }
.side button:hover { background: var(--page); }
.side button span { color: var(--soft); font-variant-numeric: tabular-nums; font-weight: 400; }
.side [aria-pressed=true], .side [aria-pressed=true]:hover { background: var(--wine-tint); color: var(--wine); font-weight: 600; }
.side [aria-pressed=true] span { color: inherit; }
.side :focus-visible { outline-offset: -2px; }
.content { padding: 1.5rem 1rem 5rem; min-width: 0; max-width: 90rem; }
.head { display: grid; gap: .25rem; }

/* Dolap */
.shelf { margin-top: 2rem; }
.shelf h2 { margin-bottom: .75rem; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(10.5rem, 44%), 1fr)); gap: 1rem; }
.grid li { position: relative; min-width: 0; }
.piece { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; overflow: hidden; text-align: left; white-space: normal; }
.piece img { width: 100%; aspect-ratio: 4/5; object-fit: cover; background: var(--sunken); }
.piece span { padding: .625rem .75rem; font-size: .9375rem; line-height: 1.35; overflow-wrap: anywhere; }
.piece:hover { border-color: var(--wine); }
.remove { position: absolute; top: .375rem; right: .375rem; width: 2.5rem; min-height: 2.5rem; padding: 0; display: grid; place-items: center; border-color: transparent; background: rgb(255 255 255 / .92); }
.remove:hover { color: var(--danger); border-color: var(--danger); }
.remove svg { width: 1.125rem; height: 1.125rem; }
.new { width: 100%; height: 100%; min-height: 8rem; padding: .75rem; display: grid; gap: .25rem; place-content: center; justify-items: center; white-space: normal; background: transparent; border: 1px dashed var(--field); color: var(--soft); }
.new::before { content: '+'; content: '+' / ''; font-size: 1.75rem; line-height: 1; font-weight: 400; }
.new:hover { color: var(--wine); border-color: var(--wine); background: var(--wine-tint); }

/* Kombin */
#looks { max-width: 90rem; margin: 0 auto; padding: 1rem 1rem 5rem; }
.looks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: .5rem; }
.anchor { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 0 1rem; align-content: start; align-items: start; justify-items: start; padding: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.anchor img { grid-row: span 3; width: 100%; aspect-ratio: 4/5; object-fit: cover; background: var(--sunken); border-radius: 4px; }
.anchor h1 { font-size: 1.25rem; }
#quiz { display: grid; gap: 1rem; align-content: start; justify-items: start; max-width: 44rem; }
progress { appearance: none; width: 100%; height: 4px; border: 0; border-radius: 2px; overflow: hidden; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--wine); }
progress::-moz-progress-bar { background: var(--wine); }
#question { font-size: 1.75rem; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: .75rem; width: 100%; }
.answers button { min-height: 4rem; text-align: left; white-space: normal; }
.answers button:hover { border-color: var(--wine); background: var(--wine-tint); }
.answers [aria-pressed=true] { border-color: var(--wine); box-shadow: inset 0 0 0 1px var(--wine); }
.results-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.results-head h2 { font-size: 1.75rem; letter-spacing: -.02em; }
#results > .note { margin-bottom: 1rem; }
.outfits { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); align-items: start; }
.outfit { display: grid; gap: .75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.lay { display: grid; gap: .375rem; }
.lay:empty { display: none; }
.lay.big { grid-template-columns: repeat(2, minmax(0, 1fr)); height: 22rem; grid-auto-rows: minmax(0, 1fr); }
.lay.n1 { grid-template-columns: 1fr; }
.lay.n3 > :first-child { grid-row: span 2; }
.lay.small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lay button { padding: 0; min-height: 0; overflow: hidden; background: var(--sunken); border-color: transparent; border-radius: 4px; }
.lay button:hover { border-color: var(--field); }
.lay img { width: 100%; height: 100%; object-fit: cover; }
.lay.n1 img, .lay.n3 > :not(:first-child) img { object-fit: contain; }
.lay.small button { aspect-ratio: 1; }
.lay .is-anchor, .lay .is-anchor:hover { border: 2px solid var(--wine); }
.outfit ul { list-style: none; margin: 0; padding: 0; font-size: .9375rem; color: var(--soft); columns: 2; column-gap: 1rem; }
.outfit li { break-inside: avoid; overflow-wrap: anywhere; }
.outfit li.is-anchor { color: var(--wine); font-weight: 600; }
.ghost { height: 30rem; background: var(--sunken); border-radius: var(--r); animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .5; } }

/* Pencereler */
dialog { width: min(48rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; border: 0; border-radius: 12px; padding: 1.5rem; color: inherit; background: var(--surface); box-shadow: 0 1.5rem 4rem rgb(25 20 27 / .25); }
dialog.small, dialog.editing { width: min(28rem, calc(100% - 2rem)); }
dialog::backdrop { background: rgb(25 20 27 / .5); }
dialog h2 { font-size: 1.375rem; }
dialog form > p, dialog > p { margin-top: .5rem; }
dialog.small label { margin: 1rem 0 .375rem; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 1.25rem; }
.editor > div { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.editor label + input, .editor label + select, .editor input + .muted { margin-top: .375rem; }
.drop { position: relative; display: grid; place-content: center; justify-items: center; gap: .25rem; min-height: 11rem; padding: 1rem; text-align: center; border: 1px dashed var(--field); border-radius: var(--r); background: var(--page); cursor: pointer; overflow: hidden; }
.drop:hover, .drop.over { border-color: var(--wine); background: var(--wine-tint); }
.drop:focus-within { outline: 2px solid var(--wine); outline-offset: 2px; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop svg { width: 2rem; height: 2rem; color: var(--wine); }
.drop.full { padding: 0; border-style: solid; }
.drop.full > :not(img, input) { display: none; }
#preview { max-width: 100%; max-height: 22rem; }
.check { display: flex; align-items: center; gap: .625rem; min-height: 2.75rem; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--wine); margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: 1.5rem; }
.actions #delete { margin-right: auto; }

/* Yönetim */
.admin { max-width: 80rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-top: 1rem; }
.row > div { flex: 1 1 10rem; max-width: 20rem; }
.row label { margin-bottom: .375rem; }
.row .error { width: 100%; }
.table { position: relative; overflow-x: auto; margin: .5rem -1.25rem 0; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .75rem 1.25rem; white-space: nowrap; }
th { font-weight: 500; font-size: .875rem; color: var(--soft); }
td:first-child { white-space: normal; min-width: 8rem; overflow-wrap: anywhere; font-weight: 500; }
tbody tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: var(--page); }
.state { padding: .25rem .625rem; border-radius: 4px; font-size: .875rem; font-weight: 500; color: var(--ok); background: #e4f2ea; }
.state.off { color: var(--danger); background: #fae9e8; }
.ops { display: flex; gap: .5rem; justify-content: flex-end; }
.ops button { min-height: 2.5rem; padding: 0 .75rem; }
#none { margin-top: 1rem; }
#audit { list-style: none; padding: 0; margin: .75rem 0 0; max-height: 24rem; overflow: auto; }
#audit li { display: flex; gap: 1.25rem; padding: .375rem 0; font-size: .9375rem; }
#audit time { color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
#audit span { overflow-wrap: anywhere; min-width: 0; }
#new-key { display: block; margin-top: 1rem; padding: 1rem; background: var(--page); border: 1px solid var(--line); border-radius: var(--r); font: 600 1.125rem/1.5 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }

#toast:not(.on) { display: none; }
#toast { position: fixed; z-index: 3; pointer-events: none; inset: auto 0 calc(1.5rem + env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content; max-width: calc(100% - 2rem); border: 0; background: var(--ink); color: #fff; padding: .75rem 1.25rem; border-radius: var(--r); }

@media (min-width: 48rem) {
  .bar { padding: 0 1.5rem; }
  .brand { font-size: 1.125rem; }
  .login { grid-template: 1fr / 1fr 1fr; }
  .login-art { align-content: space-between; padding: 3rem; }
  .login-art svg { display: block; }
  .login-art h1 { font-size: 3rem; }
  #closet { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
  .side { flex-direction: column; height: calc(100dvh - 4rem); overflow: auto; padding: 1rem .75rem; border: 0; border-right: 1px solid var(--line); }
  .content { padding: 2rem 2rem 5rem; }
  #looks { padding: 1rem 2rem 5rem; }
  .looks { grid-template-columns: 16rem minmax(0, 1fr); gap: 2rem; }
  .anchor { position: sticky; top: 5rem; grid-template-columns: minmax(0, 1fr); gap: .5rem; align-self: start; }
  .anchor img { grid-row: auto; }
  .editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editing .editor { grid-template-columns: minmax(0, 1fr); }
  .admin { padding: 2rem 2rem 4rem; }
}
/* Çentikli ekranlar ve ana ekrandan açılış */
body { padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.bar { height: calc(4rem + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
.side { top: calc(4rem + env(safe-area-inset-top)); }
.login-art { padding-top: calc(2rem + env(safe-area-inset-top)); }
@media (max-width: 47.99rem) {
  .actions button { flex: 1 1 auto; }
  .side { scrollbar-width: none; }
}
/* Dokunmatik ekranda basılı kalmış hover görünümü olmasın */
@media (hover: none) {
  .piece:hover { border-color: var(--line); }
  .answers button:hover { border-color: var(--line); background: var(--surface); }
  .answers [aria-pressed=true], .answers [aria-pressed=true]:hover { border-color: var(--wine); }
  .remove:hover { color: inherit; border-color: transparent; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
