/* Desktop layouts from the Web and Windows boards share the same content surface.
   The browser or the installed app supplies its own window chrome. */
.design-icon {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  mask: var(--icon) center / contain no-repeat;
}
.icon-chevron-right { --icon: url("icons/chevron-right.svg"); }
.icon-devices { --icon: url("icons/devices.svg"); }
.icon-eye { --icon: url("icons/eye.svg"); }
.icon-eyeoff { --icon: url("icons/eyeoff.svg"); }
.icon-fingerprint { --icon: url("icons/fingerprint.svg"); }
.icon-flameoff { --icon: url("icons/flameoff.svg"); }
.icon-half { --icon: url("icons/half.svg"); }
.icon-key { --icon: url("icons/key.svg"); }
.icon-lock { --icon: url("icons/lock.svg"); }
.icon-message { --icon: url("icons/message.svg"); }
.icon-moon { --icon: url("icons/moon.svg"); }
.icon-plus { --icon: url("icons/plus.svg"); }
.icon-search { --icon: url("icons/search.svg"); }
.icon-settings { --icon: url("icons/settings.svg"); }
.icon-shield { --icon: url("icons/shield.svg"); }
.icon-sun { --icon: url("icons/sun.svg"); }
.icon-up { --icon: url("icons/up.svg"); }
.icon-users { --icon: url("icons/users.svg"); }
.icon-x { --icon: url("icons/x.svg"); }

.mark { width: 24px; height: 24px; background: var(--brand-mark) center / contain no-repeat; }
:root { --brand-mark: url("icons/brand-light.svg"); --nav-mark: url("icons/brand-nav-light.svg"); }
:root[data-theme="dark"] { --brand-mark: url("icons/brand-dark.svg"); --nav-mark: url("icons/brand-nav-dark.svg"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand-mark: url("icons/brand-dark.svg"); --nav-mark: url("icons/brand-nav-dark.svg"); }
}

.top { position: absolute; inset: 20px 20px auto auto; padding: 0; border: 0; height: auto; z-index: 1; background: transparent; }
.iconbtn { width: 36px; height: 36px; }
.out { margin: auto 0; flex: none; align-items: center; padding-block: 72px 36px; }
.card { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.card > .brand { margin-bottom: 30px; }
.card .field input { background: var(--surface); }
.login-links { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 6px; }
.login-links #recover-link { font-size: 12px; color: var(--ink-2); font-weight: 400; }
#view-login .col { gap: 18px; }
#view-login .lead { margin-top: 6px; padding-bottom: 4px; }
#passkey-hint { text-align: center; }
button:hover:not(:disabled), .nav a:hover, summary:hover { filter: brightness(.95); }
.content { display: block; }
.page { padding: 56px 0; width: min(560px, calc(100% - 64px)); margin-left: clamp(32px, 5.625vw, 72px); gap: 0; }
.page h1, .threads h1 { font: 600 22px/28px var(--font-sans); letter-spacing: -.025em; }
.group-label { margin: 20px 0 8px; }
.rowi, details.rowd > summary { font-size: 13px; min-height: 42px; padding: 10px 16px; }
.rowi .k .i, .rowd .k .i { color: var(--ink-2); }
.rowi.block { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding-block: 16px; align-items: center; }
.rowi.block > span:first-child { font-size: 15px; }
.rowi.block .seg { grid-row: 1 / 3; grid-column: 2; }
.rowi.block .cap { grid-column: 1; }
.rowd summary > .i { color: var(--ink-3); width: 16px; height: 16px; }
.rowd .k, .rowi .k { font-weight: 400; }
.logout { align-self: flex-start; }
.account-more { margin-top: 14px; color: var(--ink-2); font-size: 12px; }
.account-more > summary { cursor: pointer; width: fit-content; }
.account-more > .group { margin-top: 10px; color: var(--ink); }
.who .n, .who .meta { display: block; }
.who { min-width: 0; }
.nav-count { margin-left: auto; }
.nav .navbrand { font-size: 15px; font-weight: 500; }
.seg .design-icon { width: 16px; height: 16px; }
.nav .mark { width: 22px; height: 22px; background-image: var(--nav-mark); }
@media (min-width:1200px) {
  .nav { border-right: 1px solid var(--line); padding: 12px; gap: 2px; }
  .nav .navbrand { padding: 4px 8px 16px; line-height: 22px; }
  .nav a { padding: 8px 10px; }
  .nav a[aria-current="page"] { border: 1px solid var(--line); }
}
@media (max-width:1199px) {
  .nav-count { display: none; }
  .navlabel { display: none; }
}
.inbox { height: 100%; display: grid; grid-template-columns: min(320px, 32%) minmax(0, 1fr); }
.threads { border-right: 1px solid var(--line); padding: 16px 8px; overflow-y: auto; }
.threads header, .dialog header, .chat-header, .thread-top, .read-count { display: flex; align-items: center; justify-content: space-between; }
.threads header { margin: 0 8px 10px; }
#thread-list { display: grid; gap: 2px; }
.search { display: flex; align-items: center; background: var(--surface-2); border-radius: 8px; height: 36px; padding: 0 10px; gap: 8px; margin: 0 8px 10px; color: var(--ink-3); }
.search .i { width: 16px; height: 16px; }
.search input { font: 400 13px/18px var(--font-sans); background: transparent; color: var(--ink); border: 0; width: 100%; min-width: 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 1px solid var(--accent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
.thread, .contact { display: flex; width: 100%; gap: 10px; align-items: center; color: var(--ink); background: transparent; text-align: left; padding: 7px 8px; }
.thread { min-height: 53px; padding: 8px; border: 0; border-radius: 8px; }
.thread[aria-pressed="true"] { min-height: 55px; border: 1px solid var(--line); background: var(--surface); }
.avatar { display: grid; place-items: center; border-radius: 50%; width: 36px; height: 36px; background: var(--surface-2); flex: none; font: 500 13px/18px var(--font-sans); }
.thread-copy { flex: 1; min-width: 0; }
.thread-top, .preview { font-size: 13px; line-height: 19px; }
strong, .thread-top strong { font-weight: 500; }
.thread time, .bubble time { color: var(--ink-3); }
.preview { display: block; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview.sealed { color: var(--seal); }
.preview .i, .chat-header .meta .i { width: 13px; height: 13px; vertical-align: -2px; margin-right: 6px; }
.contact { border: 0; border-bottom: 1px solid var(--line); padding: 8px 16px; }
.contact:last-child { border-bottom: 0; }
.empty, #view-contacts > .cap { margin: 12px 8px; }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; }
.chat-header { padding: 0 20px; min-height: 64px; border-bottom: 1px solid var(--line); gap: 12px; justify-content: flex-start; }
.chat-header > .iconbtn:last-child { margin-left: auto; }
.back-to-list { display: none; }
.timeline { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; padding: 20px 24px; }
.history { margin-top: auto; }
#reference-chat, #local-messages { display: flex; flex-direction: column; gap: 8px; }
#local-messages:not(:empty) { margin-top: 8px; }
.day { text-align: center; color: var(--ink-3); font-size: 12px; line-height: 16px; margin: 0 0 12px; }
.day span { font-size: 11px; }
.bubble { width: fit-content; max-width: 90%; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 9px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble time, .seal-card small { display: block; font: 400 11px/16px var(--font-mono); }
.bubble time { text-align: right; margin-top: 2px; }
.outgoing { align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.bubble.outgoing { background: var(--surface-2); border: 0; }
.seal-card { width: min(296px, 96%); border: 1px solid var(--seal); color: var(--seal); background: var(--seal-bg); border-radius: 14px 14px 14px 4px; overflow: hidden; font-size: 13px; line-height: 18px; }
.seal-card.outgoing { border-radius: 14px 14px 4px 14px; }
.seal-card strong, .seal-title { display: flex; gap: 6px; align-items: center; }
.seal-card .i, .seal-title .i { width: 16px; height: 16px; }
.summary { padding: 10px 12px; }
.summary small { margin-top: 6px; color: var(--ink-2); }
.spent { color: var(--ink-2); background: transparent; border-style: dashed; border-color: var(--ink-3); }
.spent small { color: var(--ink-3); }
progress { display: block; appearance: none; width: 100%; height: 4px; border: 0; background: var(--seal-line); color: var(--seal); border-radius: 3px; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--seal-line); }
progress::-webkit-progress-value { background: var(--seal); }
progress::-moz-progress-bar { background: var(--seal); }
.summary progress { margin-top: 6px; }
.envelope { padding: 12px 14px; }
.envelope small { margin-left: auto; }
.seal-lines { display: grid; gap: 7px; margin-top: 12px; }
.seal-lines i { display: block; height: 8px; width: 98%; background: var(--seal-line); border-radius: 2px; }
.seal-lines i:nth-child(2) { width: 84%; }
.seal-lines i:nth-child(3) { width: 56%; }
.incoming footer { padding: 10px 10px 10px 14px; border-top: 1px solid var(--seal-line); display: flex; align-items: center; justify-content: space-between; color: var(--ink); }
.seal-button { color: var(--on-seal); background: var(--seal); }
.composer { display: flex; align-items: end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-width: 0; field-sizing: content; min-height: 40px; max-height: 100px; resize: none; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 14px; font: 400 13px/20px var(--font-sans); }
.lock-btn, .send-btn { width: 40px; height: 40px; padding: 0; }
.lock-btn { color: var(--seal); background: var(--seal-bg); border-color: var(--seal-line); }
.note-page { max-width: 640px; width: min(640px, calc(100% - 96px)); }
.note-page .lead { margin-top: 6px; }
.note-box { display: block; position: relative; margin: 24px 0 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.note-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 .5px var(--accent); }
.note-box textarea { display: block; height: 238px; width: 100%; outline: 0; padding: 16px 16px 40px; resize: none; background: transparent; color: var(--ink); border: 0; font: 400 13px/20px var(--font-mono); }
.note-box .meta { position: absolute; right: 16px; bottom: 16px; color: var(--ink-3); pointer-events: none; }
.note-actions, .result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.note-actions > .btn { margin-left: auto; }
.note-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; padding: 12px 0 0; margin: 40px 0 0; border-top: 1px solid var(--line); }
.note-facts li + li::before { content: "·"; margin-right: 12px; }
#note-result .field { margin: 24px 0 12px; }
.dialog { box-sizing: border-box; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 36px); padding: 24px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; }
.dialog::backdrop { background: rgb(0 0 0 / 50%); }
.dialog header { align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.dialog footer { display: flex; justify-content: flex-end; margin-top: 16px; }
.dialog form .cap { margin-top: 12px; }
.reader header .meta { display: block; margin-top: 2px; }
.seal-title { font: 500 13px/18px var(--font-sans); color: var(--seal); }
.read-count { min-height: 20px; margin-top: 16px; font-size: 12px; color: var(--ink-2); }
.read-count .mono { color: var(--ink); font-size: 13px; }
.secret-text { margin: 24px 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: min(50dvh, 380px); overflow-y: auto; }
.secret-text .mono { font-size: 13px; line-height: 20px; }
.secret-text p + p { margin-top: 12px; }
.secret-text.concealed { visibility: hidden; }
.privacy { display: flex; align-items: center; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: 8px; }
.privacy .i { width: 16px; height: 16px; }
@media (max-width:780px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox .chat, .inbox.reading .threads { display: none; }
  .inbox.reading .chat, .back-to-list { display: flex; }
  .back-to-list { align-items: center; justify-content: center; }
  .note-page, .page { margin: 0 auto; width: calc(100% - 32px); }
  .rowi.block { display: flex; flex-direction: column; align-items: stretch; }
  .nav { flex-shrink: 0; }
  .nav a { padding-inline: 4px; min-width: 0; }
  .composer, .chat-header { padding-inline: 12px; }
  .timeline { padding: 16px; }
  .content { min-height: 0; }
}
@media (max-width:599px) {
  .out { padding: 72px 16px 24px; }
  .card { padding: 24px; }
  .note-actions .seg { width: auto; }
  .page { padding-block: 24px; }
}
