:root {
    --paper: #fff3f7;
    --card: #ffffff;
    --ink: #2c111f;
    --muted: #6e4b5c;
    --rose: #b8477d;
    --line: #f0d9e3;
    --line-soft: #f6e3ec;
    --blush: #fff8fb;
    --chip: #f9dce8;
    --track: #e8c6d6;
    --link: #a8336b;
    --link-hover: #7a1f4c;
}

body.brand-maki {
    --paper: #f3efe6;
    --card: #fbf9f4;
    --ink: #111111;
    --muted: #656460;
    --rose: #111111;
    --line: #e4dfd4;
    --line-soft: #ebe6dc;
    --blush: #f6f3ec;
    --chip: #e6e1d6;
    --track: #d9d3c7;
    --link: #111111;
    --link-hover: #111111;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: Jost, "Helvetica Neue", sans-serif;
    font-weight: 400;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

button, input { font-family: inherit; }

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 32px;
    border-bottom: 1px solid var(--line);
    background: var(--card);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.mark { display: block; color: var(--ink); }

body.brand-maki .word,
body.brand-maki .gate h1 {
    letter-spacing: 0.22em;
    font-weight: 400;
}

body.brand-maki .kpi,
body.brand-maki .panel,
body.brand-maki .talk {
    border: 1px solid var(--line);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.word { font-size: 24px; letter-spacing: 0.5px; }
.place { font-size: 12px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }

.nav { display: flex; flex-wrap: wrap; gap: 4px; }

.nav-link {
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--ink);
    font-size: 15px;
}

.nav-link.is-current { background: var(--ink); color: #fff; }

.who { display: flex; align-items: center; gap: 14px; }
.when { font-size: 15px; color: var(--muted); }
.who-id { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.who-name { font-size: 14px; }
.who-role { font-size: 12px; color: var(--muted); }

.avatar, .avatar-mark {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    font-size: 15px;
    cursor: pointer;
}

.who form { margin: 0; }

.sheet {
    max-width: 1520px;
    margin: 0 auto;
    padding: 24px 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.kpi, .panel {
    background: var(--card);
    border-radius: 18px;
}

.kpi { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.panel { border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }

.eyebrow {
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.figure { font-size: 34px; font-weight: 300; letter-spacing: -0.5px; line-height: 1; }
.figure.small { font-size: 26px; }
.meter { height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--rose); }
.job.mine { font-weight: 500; }
.quiet { margin: 0; font-size: 14px; color: var(--muted); }
.fresh { margin: 0; }
.alert-line { margin: 0; font-size: 15px; line-height: 1.45; }

h1, h2 { margin: 0; font-weight: 500; }
h2 { font-size: 20px; }

.panel-head, .job {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.job { font-size: 15px; }
.jobs { gap: 14px; }

.columns {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.stack { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.talk {
    flex: 999 1 560px;
    min-width: 0;
    background: var(--card);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    min-height: 680px;
}

.talk-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 28px;
    border-bottom: 1px solid var(--line-soft);
}

.talk-head h2 { font-size: 22px; }

.history {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 28px 0;
}

.history button {
    flex: none;
    max-width: 220px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--blush);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.history button.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.ghost, .prompts button, .send-solid {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ghost, .prompts button {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
}

.prompts button { min-height: 40px; padding: 0 14px; background: var(--blush); }

.send-solid { border: 0; background: var(--ink); color: #fff; }

.thread {
    flex: 1;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.mine {
    align-self: flex-end;
    max-width: 70%;
    margin: 0;
    background: var(--ink);
    color: #fff;
    padding: 14px 18px;
    border-radius: 18px 18px 4px 18px;
    font-size: 16px;
}

.hers { display: flex; gap: 12px; align-items: flex-start; max-width: 92%; }
.hers p, .hers .md { margin: 0; font-size: 16px; line-height: 1.55; }
.hers .md p { margin: 0 0 8px; }
.hers .md p:last-child { margin: 0; }
.hers .md ul, .hers .md ol { margin: 0; padding-left: 1.2rem; }
.hers .md table { border-collapse: collapse; width: 100%; margin-top: 8px; }
.hers .md th, .hers .md td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.status-line { margin: 0; color: var(--muted); font-size: 14px; }
.status-line:empty { display: none; }
.hers .card-action, .hers .ac-pushButton {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.hers .ac-adaptiveCard { max-width: 420px; }
.hers .md, .hers .ac-textBlock { overflow-wrap: anywhere; }
.hers .ac-textBlock a { color: var(--link); font-weight: 500; }

.avatar-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 0;
    background: var(--ink);
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.composer { padding: 0 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.prompts { display: flex; flex-wrap: wrap; gap: 8px; }

.composer form {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--track);
    border-radius: 18px;
    padding: 8px 8px 8px 20px;
    background: var(--card);
}

.composer input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    font-size: 16px;
    color: var(--ink);
    background: transparent;
    padding: 10px 0;
}

.composer form button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 0;
    background: var(--ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fine { margin: 0; font-size: 12px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tiles div {
    background: var(--blush);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sources p { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--track); }
.dot.is-on { background: var(--rose); }

.bars { display: flex; align-items: stretch; gap: 8px; height: 120px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.bar-fill { display: block; width: 100%; background: var(--chip); border-radius: 6px 6px 2px 2px; }
.bar-label { margin-top: 6px; font-size: 11px; color: var(--muted); text-align: center; }

.progress-intro h1, .area h1, .panel > h1 { font-size: 28px; font-weight: 400; }
.progress-intro p { margin: 8px 0 0; font-size: 16px; max-width: 42rem; }
.progress-group { display: flex; flex-direction: column; gap: 16px; }
.progress-group > h2 { font-size: 22px; }
.note h3 { margin: 0; font-size: 18px; font-weight: 500; }
.when { margin: 0; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.note ul { margin: 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 8px; }
.note li { font-size: 16px; line-height: 1.45; }
.area p, .panel > p { margin: 0; font-size: 16px; line-height: 1.5; }
.prose h1 { font-size: 22px; font-weight: 500; margin: 0; }
.prose h2 { font-size: 18px; font-weight: 500; margin: 12px 0 0; }
.prose p, .prose li { font-size: 16px; line-height: 1.5; }
.prose ol, .prose ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 8px; }
.prose a { font-weight: 500; }

.style-form {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.style-side { font-size: 16px; color: var(--muted); letter-spacing: 0.08em; }
.style-side.is-on { color: var(--ink); }

.switch { position: relative; display: inline-flex; width: 52px; height: 32px; }
.switch input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.switch-track {
    width: 52px;
    height: 32px;
    border-radius: 999px;
    background: var(--track);
    display: flex;
    align-items: center;
    padding: 3px;
}
.switch-knob {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 17, 17, 0.25);
    transition: transform 0.15s ease;
}
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--ink); outline-offset: 3px; }

.add-person, .access-list { display: flex; flex-direction: column; gap: 16px; }
.add-person { flex-direction: row; align-items: center; }
.add-person input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--track);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 16px;
    color: var(--ink);
    background: var(--card);
}
.add-person button, .access-list .send-solid { min-height: 44px; }
.access-list fieldset {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
}
.access-list legend { padding: 0 6px; font-size: 15px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check-grid label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; }

.gate {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    max-width: 420px;
    margin: 0 auto;
    padding: 48px 24px;
}

.gate h1 { font-size: 40px; font-weight: 400; letter-spacing: 0.5px; }
.gate-place { margin: 0; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.gate-note, .notice { margin: 0; color: var(--muted); line-height: 1.5; }
.notice { color: #a3123f; }

.gate-form { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }
.gate-form label { font-size: 14px; }
.gate-form input {
    min-height: 44px;
    border: 1px solid var(--track);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 16px;
    color: var(--ink);
    background: var(--card);
}

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

@media (max-width: 720px) {
    .top, .sheet { padding-left: 16px; padding-right: 16px; }
    .talk { min-height: 0; }
    .mine { max-width: 100%; }
}

/* Chat: tænkivísari */
.thinking { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: var(--blush); border: 1px solid var(--line-soft); color: var(--muted); font-size: 14px; }
.thinking-dots { display: inline-flex; gap: 4px; }
.thinking-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); opacity: .35; animation: lilja-dot 1.2s ease-in-out infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
.thinking-text { background: linear-gradient(90deg, var(--muted) 0%, var(--rose) 50%, var(--muted) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lilja-shimmer 2.4s linear infinite; }
@keyframes lilja-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes lilja-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
    .thinking-dots i, .thinking-text { animation: none; }
    .thinking-dots i { opacity: .7; }
    .thinking-text { color: var(--muted); background: none; }
}

/* Chat: fílur */
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 4px 8px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: 13px; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; }
.file-chip button { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.attach { background: none; border: 0; color: var(--muted); cursor: pointer; }
.mine p { margin: 0; }
.mine-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mine-files img { max-width: 160px; max-height: 120px; border-radius: 10px; }
.talk.is-dropping { outline: 2px dashed var(--rose); outline-offset: 4px; }
