/* Rude client portal — light and clear for clients; Rude red + black as accents (logo never white).
   Titles: Oskari G2 Medium. Body: AOT Serial Mono. */
@font-face { font-family: "Oskari G2"; src: url("../assets/fonts/oskari-g2-medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Serial Mono"; src: url("../assets/fonts/aot-serial-mono.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --red: #a8100f;
  --red-soft: #f7e7e6;
  --ink: #121110;
  --muted: #4c4e46;
  --bg: #c2c4ba;                 /* page background */
  --card: #d2d4cb;               /* cards, inputs, calendar days — a step lighter than the page */
  --surface: #b5b8ac;            /* quiet fills: tags, comments, empty states */
  --line: rgba(18, 17, 16, .16);
  --sage: #5f7e54;
  --sage-soft: #e9f0e5;
  --cobalt: #2350b4;
  --cobalt-soft: #e6ecf8;
  --f-title: "Oskari G2", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Serial Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 2.6vw, 36px);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 17, 16, .06), 0 8px 24px rgba(18, 17, 16, .06);
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 600 13px/1.55 var(--f-mono); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
b, strong { font-weight: 700; }
.display { font-family: var(--f-title); font-weight: 500; letter-spacing: -.045em; line-height: .95; margin: 0; }
.muted { color: var(--muted); }
.boot { padding: 40px var(--gutter); color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.logo { height: 26px; width: auto; display: block; color: var(--ink); flex: none; } /* the Rude logo is always black here */

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; white-space: nowrap; text-decoration: none; transition: border-color .2s, background .2s, color .2s; }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--red { background: var(--red); border-color: var(--red); color: #fff; }
.btn--red:hover:not(:disabled) { background: #8d0d0c; border-color: #8d0d0c; }
.btn--ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--quiet { border-color: transparent; background: transparent; }
.btn--quiet:hover:not(:disabled) { background: var(--surface); border-color: transparent; }
.btn--sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn--icon { width: 36px; padding: 0; }
.btn:disabled { opacity: .45; cursor: default; }

/* inputs */
.field { display: grid; gap: 6px; }
.field > span { font-size: 11px; font-weight: 700; color: var(--muted); }
.input { width: 100%; height: 42px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--ink); }
textarea.input { height: auto; min-height: 100px; padding: 11px 14px; resize: vertical; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input::placeholder { color: #7e8077; }
.choices { display: flex; gap: 6px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 99px; border: 1.5px solid var(--line); font-weight: 700; font-size: 12px; cursor: pointer; }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

/* status */
.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; color: #fff; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.st--draft { color: var(--muted); border: 1.5px dashed #85877e; }
.st--in_review { background: var(--cobalt); }
.st--changes { background: var(--red); }
.st--approved { background: var(--sage); }

/* ---------------------------------------------------------------- sign in */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login__side { background: var(--red); color: var(--ink); padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; }
.login__side .logo { color: var(--ink); height: 34px; align-self: flex-start; }
.login__side h1 { font-size: clamp(56px, 8.5vw, 132px); }
.login__side p { max-width: 36ch; margin: 0; font-weight: 700; }
.login__box { padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 560px; }
.login__box h2 { font-family: var(--f-title); font-weight: 500; font-size: 40px; letter-spacing: -.04em; margin: 0; }
.login__box form { display: grid; gap: 10px; }
.login__box .input, .login__box .btn { height: 48px; font-size: 14px; }
.login__sent { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; line-height: 1.7; }
.demo { border-top: 1.5px solid var(--line); padding-top: 18px; display: grid; gap: 12px; color: var(--muted); }
.demo div { display: flex; gap: 8px; flex-wrap: wrap; }
.nothing { min-height: 100vh; display: grid; place-items: center; padding: 40px var(--gutter); }
.nothing > div { max-width: 520px; display: grid; gap: 18px; }
.nothing h1 { font-size: clamp(48px, 7vw, 84px); color: var(--red); }

/* ---------------------------------------------------------------- shell */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 12px var(--gutter); background: rgba(194, 196, 186, .92); backdrop-filter: blur(10px); border-bottom: 1.5px solid var(--line); }
.top__client { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1.5px solid var(--line); }
.top__client select { height: 36px; width: auto; min-width: 150px; border-radius: 99px; font-weight: 700; }
.top__client b { font-family: var(--f-title); font-weight: 500; font-size: 22px; letter-spacing: -.03em; }
.tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 99px; }
.tabs .btn { border-color: transparent; background: transparent; height: 32px; }
.tabs .btn.is-on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.top__me { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top__me span { font-size: 11px; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner { margin: 0; padding: 9px var(--gutter); background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 700; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
main.page { padding: 30px var(--gutter) 90px; max-width: 1480px; margin: 0 auto; }
.head { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { font-size: clamp(40px, 5.5vw, 76px); }
.head h1 span { color: #888a80; }
.head__tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; gap: 2px; background: var(--surface); padding: 3px; border-radius: 99px; }
.seg .btn { border-color: transparent; background: transparent; height: 30px; }
.seg .btn.is-on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.empty { background: var(--surface); border-radius: var(--radius); padding: 44px 24px; text-align: center; color: var(--muted); }
.attention { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius); background: var(--cobalt-soft); color: var(--cobalt); font-weight: 700; margin-bottom: 22px; }
.attention p { margin: 0 auto 0 0; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 18px; }
.legend button { border: 0; background: none; padding: 0; transition: opacity .2s; }
.legend.is-filtered button { opacity: .4; }
.legend button.is-on, .legend button:hover { opacity: 1; }

/* ---------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(18, 17, 16, .14); gap: 1.5px; }
.cal__dow { padding: 9px 12px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface); }
.cal__day { min-height: 132px; padding: 8px; background: var(--card); display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.cal__day.is-out { background: #c9cbc1; }
.cal__day.is-out .cal__n { color: #8c8e85; }
.cal__n { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.cal__day.is-today .cal__n { background: var(--red); color: #fff; }
.cal__add { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); display: none; place-items: center; padding: 0; font-weight: 700; }
.cal__day:hover .cal__add { display: grid; }
.cal__add:hover { border-color: var(--ink); }
.chip { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: center; text-align: left; border: 1.5px solid var(--line); border-left: 4px solid var(--c, var(--line)); border-radius: 9px; padding: 4px 6px 4px 4px; background: var(--card); min-width: 0; transition: box-shadow .2s, transform .2s var(--ease); }
.chip:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.chip__img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; background: var(--surface); }
.chip__t { font-size: 11px; line-height: 1.3; min-width: 0; }
.chip__t b, .chip__t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip__t span { color: var(--muted); font-size: 10px; }
.chip--draft { --c: #85877e; border-style: dashed; border-left-style: solid; }
.chip--in_review { --c: var(--cobalt); }
.chip--changes { --c: var(--red); }
.chip--approved { --c: var(--sage); }

/* list view */
.list { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 150px 72px 1fr auto auto; gap: 18px; align-items: center; padding: 10px 14px 10px 10px; border: 1.5px solid var(--line); border-radius: var(--radius); text-align: left; background: var(--card); width: 100%; transition: box-shadow .2s; }
.row:hover { box-shadow: var(--shadow); }
.row__img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--surface); }
.row__date b { display: block; }
.row__date span { color: var(--muted); font-size: 12px; }
.row__t b { display: block; font-family: var(--f-title); font-weight: 500; font-size: 22px; letter-spacing: -.03em; line-height: 1.15; }
.row__t span { font-size: 12px; color: var(--muted); }
.row__plat { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--surface); font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ---------------------------------------------------------------- profile grid */
.grid-wrap { max-width: 640px; margin: 0 auto; }
.profile { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 6px 0 22px; }
.profile__avatar { width: 92px; height: 92px; border-radius: 50%; background: var(--red); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--line); }
.profile__avatar .logo { color: var(--ink); height: 22px; }
.profile__name { font-family: var(--f-title); font-weight: 500; font-size: 30px; letter-spacing: -.03em; line-height: 1; }
.profile__handle { color: var(--muted); font-weight: 700; margin: 4px 0 10px; }
.profile__stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; }
.profile__stats b { font-size: 15px; }
.feedtabs { display: flex; justify-content: center; gap: 28px; border-top: 1.5px solid var(--line); margin-bottom: 2px; }
.feedtabs button { border: 0; background: none; padding: 12px 2px; font-weight: 700; font-size: 12px; color: var(--muted); border-top: 2px solid transparent; margin-top: -1.5px; }
.feedtabs button.is-on { color: var(--ink); border-top-color: var(--ink); }
.feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tile { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface); border: 0; padding: 0; }
.feed--tiktok .tile { aspect-ratio: 9 / 16; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tile:hover img, .tile:hover video { transform: scale(1.04); }
.tile__ic { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.tile__st { position: absolute; top: 8px; left: 8px; }
.tile__st .st { height: 20px; font-size: 10px; padding: 0 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.tile__st .st--draft { background: var(--card); }
.tile__date { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; font-size: 10.5px; font-weight: 700; text-align: left; }
.tile.is-live::after { content: "Live"; position: absolute; right: 8px; bottom: 7px; color: #fff; font-size: 10px; font-weight: 700; }
.tile--empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: var(--ink); color: #fff; font-family: var(--f-title); font-size: 18px; letter-spacing: -.02em; text-align: center; }
.grid-note { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 0; }

/* ---------------------------------------------------------------- post view */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 3vh 2vw; }
.modal__scrim { position: absolute; inset: 0; background: rgba(18, 17, 16, .55); animation: fade .3s; }
.modal__card { position: relative; width: min(1180px, 100%); height: min(860px, 94vh); background: var(--card); border-radius: 20px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, 1fr); box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: pop .45s var(--ease); }
@keyframes pop { from { transform: translateY(16px) scale(.985); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.viewer { background: #121110; position: relative; display: grid; grid-template-rows: 1fr auto; min-height: 0; }
.viewer__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 20px; }
.viewer__frame { position: relative; height: 100%; max-height: 100%; aspect-ratio: var(--ar, 4 / 5); max-width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.viewer__frame img, .viewer__frame video, .viewer__frame iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.viewer__frame video { object-fit: contain; background: #000; }
.viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--ink); font-weight: 700; font-size: 16px; display: grid; place-items: center; }
.viewer__nav--prev { left: 14px; } .viewer__nav--next { right: 14px; }
.viewer__dots { display: flex; justify-content: center; gap: 6px; padding: 0 0 16px; }
.viewer__dots button { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.35); }
.viewer__dots button.is-on { background: #fff; }
.viewer__label { position: absolute; left: 20px; top: 18px; color: #fff; font-size: 11px; font-weight: 700; opacity: .8; }
.viewer__empty { color: #8b8580; }
.viewer__close { display: none; position: absolute; top: 12px; right: 12px; z-index: 2; }
.details { overflow: auto; padding: 22px 26px 30px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.details > * { flex-shrink: 0; } /* scroll the panel instead of squashing its sections */
.details__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.details h2 { font-size: clamp(34px, 3.6vw, 50px); }
.facts { display: grid; border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fact { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 12px 16px; align-items: center; }
.fact + .fact { border-top: 1.5px solid var(--line); }
.fact > span:first-child { color: var(--muted); font-size: 12px; font-weight: 700; }
.fact .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.yes, .no { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 99px; font-weight: 700; font-size: 12px; }
.yes { background: var(--sage-soft); color: var(--sage); }
.no { background: var(--surface); color: var(--muted); }
.handle { color: var(--cobalt); font-weight: 700; }
.capbox { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.capbox header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.capbox p { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.65; }
.decide { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); border: 1.5px solid var(--line); }
.decide--in_review { background: var(--cobalt-soft); border-color: transparent; }
.decide p { margin: 0; font-weight: 700; }
.decide__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.files { display: flex; gap: 6px; flex-wrap: wrap; }
.thread { display: grid; gap: 10px; }
.thread h3 { font-family: var(--f-title); font-weight: 500; font-size: 26px; letter-spacing: -.03em; margin: 6px 0 2px; }
.msg { border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.msg--mine { background: var(--red-soft); }
.msg header { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 3px; flex-wrap: wrap; }
.msg header b { color: var(--ink); }
.msg p { margin: 0; white-space: pre-wrap; }
.thread form { display: grid; gap: 8px; }
.thread form .btn { justify-self: end; }

/* editor */
.form { display: grid; gap: 16px; }
.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
.toggle b { font-size: 13px; }
.toggle small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #a4a69b; transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--sage); }
.switch input:checked + i::after { transform: translateX(18px); }
.media-edit { display: flex; gap: 8px; flex-wrap: wrap; }
.media-edit figure { margin: 0; position: relative; width: 88px; height: 110px; border-radius: 10px; overflow: hidden; background: var(--surface); }
.media-edit figure img, .media-edit figure video { width: 100%; height: 100%; object-fit: cover; }
.media-edit figure button { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 99px; border: 0; background: #fff; padding: 0; font-weight: 700; box-shadow: var(--shadow); }
.media-edit figure em { position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: 9px; font-weight: 700; background: #fff; border-radius: 99px; padding: 1px 6px; }
.media-edit label { width: 88px; height: 110px; border-radius: 10px; border: 1.5px dashed #85877e; display: grid; place-items: center; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer; padding: 6px; }
.media-edit label:hover { border-color: var(--ink); color: var(--ink); }
.form__foot { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; position: sticky; bottom: -30px; background: var(--card); padding: 12px 0 0; }

/* ---------------------------------------------------------------- assets */
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.asset { border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; background: var(--card); transition: box-shadow .2s; }
.asset:hover { box-shadow: var(--shadow); }
.asset__prev { aspect-ratio: 1; background: var(--surface); display: grid; place-items: center; border: 0; padding: 0; width: 100%; color: var(--red); }
.asset__prev img, .asset__prev video { width: 100%; height: 100%; object-fit: cover; }
.asset__ext { font-family: var(--f-title); font-weight: 500; font-size: 34px; letter-spacing: -.03em; }
.asset__info { padding: 10px 12px 12px; display: grid; gap: 2px; }
.asset__info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset__info span { font-size: 11px; color: var(--muted); }
.asset__acts { display: flex; gap: 6px; margin-top: 8px; }
.drop { position: fixed; inset: 0; z-index: 60; background: rgba(168, 16, 15, .92); color: #fff; display: grid; place-items: center; font-family: var(--f-title); font-size: clamp(40px, 6vw, 80px); letter-spacing: -.04em; pointer-events: none; }
.drop[hidden] { display: none; }
.uploading { margin-bottom: 14px; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(18, 17, 16, .92); display: grid; place-items: center; padding: 40px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 86vh; border-radius: 10px; }
.lightbox .btn { position: absolute; top: 18px; right: 18px; }

/* ---------------------------------------------------------------- team */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.card { border: 1.5px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 12px; align-content: start; background: var(--card); }
.card h3 { font-family: var(--f-title); font-weight: 500; font-size: 28px; letter-spacing: -.03em; margin: 0; line-height: 1.05; }
.card h3 small { display: block; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.card__top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.card__top div:last-child { display: flex; gap: 4px; }
.people { display: grid; }
.person { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 0; border-bottom: 1.5px solid var(--line); }
.person span { overflow: hidden; text-overflow: ellipsis; }
.inline { display: flex; gap: 8px; }
.inline .input { height: 36px; }
.section-title { font-family: var(--f-title); font-weight: 500; font-size: 40px; letter-spacing: -.04em; margin: 50px 0 14px; }

/* dialog + toast */
.dialog { position: fixed; inset: 0; z-index: 80; background: rgba(18, 17, 16, .5); display: grid; place-items: center; padding: 20px; }
.dialog__card { background: var(--card); border-radius: 18px; padding: 22px; width: min(440px, 100%); display: grid; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.dialog__card h3 { font-family: var(--f-title); font-weight: 500; font-size: 28px; letter-spacing: -.03em; margin: 0; }
.dialog__card p { margin: 0; color: var(--muted); }
.dialog__btns { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; pointer-events: none; transition: .25s var(--ease); z-index: 90; max-width: calc(100% - 32px); text-align: center; font-weight: 700; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .modal { padding: 0; }
  .modal__card { grid-template-columns: 1fr; grid-template-rows: auto; height: 100%; border-radius: 0; overflow: auto; }
  .viewer { min-height: 62vh; }
  .viewer__close { display: inline-flex; }
  .viewer__frame { height: 56vh; }
  .details { overflow: visible; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__side { min-height: 46vh; }
  .top { flex-wrap: wrap; gap: 10px; }
  .top__client { border: 0; padding: 0; }
  .top__me span { display: none; }
  .tabs { order: 3; width: 100%; overflow: auto; }
  .tabs .btn { flex: 1; }
  .cal__dow { padding: 6px 2px; text-align: center; }
  .cal__day { min-height: 70px; padding: 4px; }
  .chip { grid-template-columns: 1fr; padding: 2px; border-left-width: 3px; }
  .chip__img { width: 100%; height: 30px; }
  .chip__t { display: none; }
  .row { grid-template-columns: 60px 1fr auto; gap: 12px; }
  .row__img { width: 60px; height: 60px; }
  .row__date, .row__plat { display: none; }
  .form .grid2 { grid-template-columns: 1fr; }
  .fact { grid-template-columns: 1fr; gap: 4px; }
  .profile { gap: 14px; }
  .profile__avatar { width: 70px; height: 70px; }
}

/* import from Drive */
.dialog__card--wide { width: min(660px, 100%); max-height: 88vh; overflow: auto; }
.stack { display: grid; gap: 12px; }
.err { color: var(--red) !important; font-weight: 700; }
.imp { display: grid; gap: 6px; max-height: 42vh; overflow: auto; }
.imp__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px; background: var(--card); }
.imp__row input { accent-color: var(--ink); width: 16px; height: 16px; }
.imp__row .muted { margin-right: auto; }
