@font-face { font-family: "Fira Code Variable"; font-style: normal; font-display: block; font-weight: 300 700; src: url("/fonts/fira-code-cyrillic-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Fira Code Variable"; font-style: normal; font-display: block; font-weight: 300 700; src: url("/fonts/fira-code-cyrillic-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Fira Code Variable"; font-style: normal; font-display: block; font-weight: 300 700; src: url("/fonts/fira-code-greek-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Fira Code Variable"; font-style: normal; font-display: block; font-weight: 300 700; src: url("/fonts/fira-code-greek-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Fira Code Variable"; font-style: normal; font-display: block; font-weight: 300 700; src: url("/fonts/fira-code-symbols2-wght-normal.woff2") format("woff2-variations"); unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F; }
@font-face { font-family: "Fira Code Variable"; font-style: normal; font-display: block; font-weight: 300 700; src: url("/fonts/fira-code-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fira Code Variable"; font-style: normal; font-display: block; font-weight: 300 700; src: url("/fonts/fira-code-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Retro Computer"; font-display: block; src: url("/fonts/retro-computer.ttf") format("truetype"); }

:root {
    --c-050: #101014;
    --c-075: #18181e;
    --c-100: #202028;
    --c-125: #282832;
    --c-150: #30303c;
    --c-200: #404050;
    --c-250: #505064;
    --c-300: #606078;
    --c-400: #8080a0;
    --c-500: #a0a0c8;
    --c-600: #c0c0f0;
    --c-700: #e0e0ff;
    --accent: #ff6fae;
    --aqua: #5fd7ee;
    --page-width: 1100px;
    --editor-gap: 42px;

    --font-main: "Fira Code Variable", ui-monospace, Consolas, monospace;
    --font-retro: "Retro Computer", var(--font-main);
}

* { box-sizing: border-box; }
@supports selector(::-webkit-scrollbar) {
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--c-250); border-radius: 4px; }
    ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}
@supports not selector(::-webkit-scrollbar) {
    * { scrollbar-width: thin; scrollbar-color: var(--c-250) transparent; }
}

h1, h2, button, a.button, .tile, a.memo, .tag, .dialog .title, .dialog .label { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

::placeholder { -webkit-user-select: none; user-select: none; }

input, textarea, button, select { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
    background: var(--c-100);
    color: var(--c-600);
    font-family: var(--font-main);
    font-size: 15px;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    line-height: 1.5;
}

h1, h2 { margin: 0; font-weight: 400; color: var(--c-700); }
h1 { font-size: 28px; letter-spacing: 2px; }
h2 { font-family: var(--font-retro); font-size: 16px; text-transform: uppercase; color: var(--c-400); margin-bottom: 16px; }

.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }

.card { background: var(--c-125); border: 1px solid var(--c-150); border-radius: 6px; padding: 24px; width: 100%; max-width: 640px; }
.card.narrow { max-width: 360px; }
#pageView .card { max-width: var(--page-width); }
.card h1 { margin-bottom: 20px; }

label { display: block; font-family: var(--font-retro); font-size: 14px; text-transform: uppercase; color: var(--c-400); margin-bottom: 14px; }

input {
    display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
    background: var(--c-050); color: var(--c-700); border: 1px solid var(--c-200); border-radius: 4px;
    font-family: var(--font-main); font-size: 15px;
}
input:focus { outline: none; border-color: var(--c-500); }

.wrap { position: relative; display: block; margin-top: 6px; }
.wrap input { margin-top: 0; }
.wrap input.secret { padding-right: 42px; }
.mask { -webkit-text-security: disc; text-security: disc; }
.wrap .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: auto; padding: 6px; background: none; border: 0; color: var(--c-400); line-height: 0; }
.wrap .eye:hover, .wrap .eye.on { background: none; color: var(--c-700); }

button, a.button {
    background: var(--c-150); color: var(--c-700); border: 1px solid var(--c-250); border-radius: 4px;
    padding: 9px 14px; cursor: pointer; font-family: var(--font-retro); font-size: 14px; text-transform: uppercase;
}
button:hover, a.button:hover { background: var(--c-200); border-color: var(--c-400); }
a.button { display: inline-block; text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--c-050); }
button.primary:hover { filter: brightness(1.1); }
form button { width: 100%; }

.message { min-height: 1.5em; margin: 12px 0 0; color: var(--accent); font-size: 13px; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 19px; background: var(--c-075); border-bottom: 1px solid var(--c-150); cursor: pointer; }
.actions { display: flex; flex-shrink: 0; gap: 8px; }
.bar h1 { min-width: 0; font-size: 22px; letter-spacing: 1.6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { display: flex; justify-content: center; padding: 24px 16px; }

.trust { margin-bottom: 16px; }
.trustbox { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0; }
.trustbox .trust { width: 100%; max-width: 320px; margin: 16px 0 0; }
.clock { font-family: var(--font-retro); font-size: 28px; letter-spacing: 2px; color: var(--c-700); }
.devices { list-style: none; margin: 0; padding: 0; }
.devices li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--c-150); }
.devices li:first-child { border-top: 0; }
.devices .info { flex: 1; min-width: 0; }
.devices .buttons { display: flex; flex-shrink: 0; gap: 8px; }
.devices .name input { display: block; width: 100%; max-width: 260px; margin: 0; padding: 4px 8px; }
.devices .meta { font-size: 12px; color: var(--c-400); }
.devices .name { color: var(--c-700); }
.tag { font-family: var(--font-retro); font-size: 12px; text-transform: uppercase; padding: 2px 6px; margin-left: 8px; border: 1px solid var(--c-300); border-radius: 3px; color: var(--c-500); }
.tag.session { border-color: var(--accent); color: var(--accent); }

body.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#scroller { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; touch-action: manipulation; }
html, body, #scroller { overscroll-behavior-y: none; }
.pull { position: fixed; left: 50%; top: 0; z-index: 6; pointer-events: none; }
.pull .spinner { margin: 0; }
#scroller, .dialog { scrollbar-width: none; }
#scroller::-webkit-scrollbar, .dialog::-webkit-scrollbar { display: none; }
body.app main { flex: 1; }
.thumb { position: fixed; top: 0; left: 0; width: 12px; touch-action: none; }
.autoscroll { position: fixed; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: space-between; width: 28px; height: 46px; margin: -23px 0 0 -14px; padding: 3px 0; background: var(--c-100); border: 1px solid var(--c-300); border-radius: 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); color: var(--c-400); pointer-events: none; }
.autoscroll .arrow { display: block; line-height: 0; }
.autoscroll .arrow svg { width: 14px; height: 14px; }
.autoscroll .arrow.on { color: var(--accent); }
.autoscroll .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--c-300); }
.autoscrolling, .autoscrolling * { cursor: none !important; }
.thumb::after { content: ""; position: absolute; top: 0; bottom: 0; right: 3px; width: 5px; border-radius: 3px; background: var(--c-250); opacity: 0.7; }
.thumb:hover::after, .thumb.drag::after { background: var(--c-400); opacity: 1; }
.bar a { color: inherit; text-decoration: none; }
.bar button, .bar a.button { padding: 7px 11px; font-size: 11px; }
main.home { align-items: center; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; width: 100%; max-width: 660px; }
.tile {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    background: var(--c-125); border: 1px solid var(--c-150); border-radius: 16px;
    color: var(--c-700); text-decoration: none; text-transform: uppercase;
    font-family: var(--font-retro); font-size: 20px;
}
.tile svg { width: 44px; height: 44px; color: var(--c-500); }
.tile:hover { background: var(--c-150); border-color: var(--accent); }
.tile:hover svg { color: var(--accent); }
#pageBody > p.meta { color: var(--c-400); font-size: 13px; margin: 0; }

.centered { text-align: center; }

.spinner { width: 32px; height: 32px; margin: 24px auto; border: 3px solid var(--c-200); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
    .tiles { gap: 12px; }
    .tile { font-size: 12px; gap: 10px; }
    .tile svg { width: 32px; height: 32px; }
}
@media (max-width: 400px) {
    .tile { font-size: 11px; }
}

.listing { width: 100%; max-width: 720px; }
.search { margin: 0 0 16px; }
.items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.item {
    min-height: 64px; padding: 16px; text-align: left; text-transform: none;
    font-family: var(--font-main); font-size: 15px; color: var(--c-700);
    background: var(--c-125); border: 1px solid var(--c-150); border-radius: 10px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item:hover { background: var(--c-150); border-color: var(--accent); }
.item.add { display: flex; align-items: center; justify-content: center; border-style: dashed; color: var(--c-400); font-family: var(--font-retro); font-size: 20px; }
.item.busy { display: flex; align-items: center; justify-content: center; }
.item.busy .spinner { margin: 0; }

.modal { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgba(16, 16, 20, 0.78); }
.dialog { width: 80vw; height: 80vh; padding: 28px; overflow: auto; display: flex; flex-direction: column; background: var(--c-125); border: 1px solid var(--c-200); border-radius: 16px; }
.dialog input { margin-top: 0; }
.dialog input.number { text-align: center; }
.dialog textarea.grow { display: block; width: 100%; margin: 0; padding: 10px 12px; overflow: hidden; resize: none; background: var(--c-050); color: var(--c-700); border: 1px solid var(--c-200); border-radius: 4px; font-family: var(--font-main); font-size: 15px; -webkit-user-select: text; user-select: text; }
.dialog textarea.grow:focus { outline: none; border-color: var(--c-500); }
.dialog textarea.grow.title { font-size: 22px; }
.dialog .title { font-size: 22px; }
.dialog .label { margin: 22px 0 8px; font-family: var(--font-retro); font-size: 12px; text-transform: uppercase; color: var(--c-400); }
.dialog .label:first-child { margin-top: 0; }
.dialog .file { color: var(--c-500); font-size: 14px; word-break: break-all; }
.paths { display: flex; flex-direction: column; gap: 8px; }
.path { background: var(--c-050); border: 1px solid var(--c-150); border-left: 3px solid var(--accent); border-radius: 4px; padding: 10px 12px; font-size: 14px; }
.dialog .buttons { margin-top: auto; padding-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.dialog .buttons .armed { background: var(--accent); border-color: var(--accent); color: var(--c-050); }
.dialog button.info { display: block; width: 100%; flex: none; margin-top: 28px; padding: 14px 16px; font-size: 16px; letter-spacing: 1px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); }
.dialog button.info:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.dialog .status { min-height: 1.5em; margin: 12px 0 0; color: var(--accent); font-size: 13px; }
.entry .status { min-height: 0; margin: 6px 0 0; }
.entry .status:empty { display: none; }
@media (max-width: 600px) {
    .dialog { width: 94vw; height: 90vh; padding: 20px; }
    .dialog textarea.grow { font-size: 16px; }
    .dialog textarea.grow.title { font-size: 18px; }
    .items { gap: 12px; }
}

.columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; width: 100%; max-width: var(--page-width); }
.column { display: flex; flex-direction: column; min-width: 0; }
.column h2 { margin-bottom: 12px; text-align: center; }
.column .content, .page .content { display: flex; padding: 16px 0; background: var(--c-125); border: 1px solid var(--c-150); border-radius: 10px; }
.column .content { flex: 1; min-height: 240px; }
.column .content textarea, .page .content textarea { flex: 1; width: 100%; min-height: 208px; overflow: hidden; resize: none; }
.column .content textarea:focus, .page .content textarea:focus { outline: none; }
.field { position: relative; display: flex; flex: 1; min-width: 0; }
.field textarea, .field .mirror, .field .marks { margin: 0; padding: 0 16px; border: 0; font-family: var(--font-main); font-size: 15px; line-height: 1.5; letter-spacing: normal; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; }
.field textarea { background: none; color: transparent; caret-color: var(--c-700); }
.field textarea::selection { background: rgba(255, 111, 174, 0.35); color: transparent; }
.field .mirror, .field .marks { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: var(--c-700); }
.field .marks { color: transparent; }
.marks mark { color: transparent; background: rgba(255, 200, 70, 0.28); border-radius: 2px; }
.marks mark.on { background: rgba(255, 200, 70, 0.6); box-shadow: 0 0 0 1px rgba(255, 200, 70, 0.9); }
.mirror .h { color: var(--accent); }
.mirror .h.flash { border-radius: 3px; animation: flash 1s ease-out; }
@keyframes flash { from { background: rgba(255, 111, 174, 0.35); } to { background: transparent; } }
.mirror .c { color: var(--aqua); background: rgba(95, 215, 238, 0.14); border-radius: 3px; font-variant-ligatures: normal; font-feature-settings: "liga" 1, "calt" 1; }
.mirror .c.copied { animation: copied 0.9s ease-out; }
@keyframes copied { from { background: rgba(95, 215, 238, 0.6); color: #fff; } }
.mirror .tick { color: transparent; }
.mirror .cb { position: relative; display: inline-block; width: 100%; vertical-align: top; color: #4ea1ee; background: rgba(78, 161, 238, 0.14); font-variant-ligatures: normal; font-feature-settings: "liga" 1, "calt" 1; }
.mirror .cb::before, .mirror .cb::after { content: ""; position: absolute; top: 0; bottom: 0; width: 16px; background: inherit; }
.mirror .cb::before { right: 100%; }
.mirror .cb::after { left: 100%; }
.mirror .cb.fence { color: rgba(78, 161, 238, 0.55); }
.outline { position: fixed; right: max(6px, calc((100vw - var(--page-width)) / 2 - 46px)); z-index: 4; display: flex; align-items: center; justify-content: flex-end; pointer-events: none; -webkit-user-select: none; user-select: none; }
.outline-card { display: flex; align-items: center; max-height: 100%; pointer-events: auto; }
.outline-zone { position: fixed; z-index: 3; }
.outline-ticks { display: flex; flex-direction: column; align-items: flex-end; max-height: 100%; padding: 20px 6px 20px 12px; overflow: hidden; cursor: pointer; }
.outline-tick { flex: 0 1 15px; display: flex; align-items: center; justify-content: flex-end; min-height: 7px; width: 26px; }
.outline-tick::after { content: ""; width: 26px; height: 4px; border-radius: 2px; background: var(--c-300); }
.outline-tick[data-depth="1"]::after { width: 19px; }
.outline-tick[data-depth="2"]::after { width: 14px; }
.outline-tick[data-depth="3"]::after { width: 10px; }
.outline-tick:hover::after { background: var(--c-500); }
.outline-tick.on::after { background: var(--accent); }
.outline-panel { display: flex; flex-direction: column; width: 300px; max-width: calc(100vw - 80px); max-height: min(70vh, 560px); margin-right: 2px; padding: 6px; background: var(--c-075); border: 1px solid var(--c-250); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.outline-panel input { margin: 0 0 6px; padding: 6px 10px; font-size: 13px; }
.outline-list { position: relative; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--c-250) transparent; }
.outline-item { position: relative; padding: 5px 10px 5px calc(10px + var(--depth, 0) * 14px); border-radius: 6px; font-size: 13px; line-height: 1.4; color: var(--c-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.outline-item[data-depth="0"] { color: var(--c-600); }
.outline-item:hover, .outline-item.sel { background: var(--c-150); color: var(--c-700); }
.outline-item.on { color: var(--accent); }
.outline-item.on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 1px; background: var(--accent); }
.outline-empty { padding: 5px 10px; font-size: 13px; color: var(--c-400); }
@media (max-width: 1203px) {
    .outline { right: max(13px, calc((100vw - var(--page-width)) / 2 - 3px)); }
    .outline-ticks { padding: 16px 6px; }
    .outline-tick { width: 24px; }
    .outline-tick::after { width: 14px; }
    .outline-tick[data-depth="1"]::after { width: 11px; }
    .outline-tick[data-depth="2"]::after { width: 8px; }
    .outline-tick[data-depth="3"]::after { width: 6px; }
}
@media (hover: none) and (pointer: coarse) {
    .outline-zone { display: none; }
}
.nav-flash { animation: nav-flash 0.9s ease-out; }
@keyframes nav-flash { from { background-color: rgba(255, 111, 174, 0.35); border-color: var(--accent); } }
.outline-left { right: auto; left: max(6px, calc((100vw - var(--page-width)) / 2 - 46px)); justify-content: flex-start; }
.outline-left .outline-card { flex-direction: row-reverse; }
.outline-left .outline-ticks { align-items: flex-start; padding: 20px 12px 20px 6px; }
.outline-left .outline-tick { justify-content: flex-start; }
.outline-left .outline-panel { margin-right: 0; margin-left: 2px; }
@media (max-width: 1203px) {
    .outline-left { left: max(13px, calc((100vw - var(--page-width)) / 2 - 3px)); }
    .outline-left .outline-ticks { padding: 16px 6px; }
}
.find-anchor { position: sticky; top: 8px; z-index: 4; flex: none; align-self: flex-start; width: 100%; height: 0; margin-right: -100%; pointer-events: none; }
.find { position: absolute; top: 0; right: 8px; display: flex; flex-direction: column; gap: 6px; max-width: calc(100% - 16px); padding: 6px; background: var(--c-100); border: 1px solid var(--c-250); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); pointer-events: auto; }
.find-row { display: flex; align-items: center; gap: 4px; }
.find-row input { flex: 1; min-width: 80px; width: 200px; margin: 0; padding: 4px 8px; font-size: 14px; }
.find-row input.bad { border-color: var(--accent); }
.find-count { flex: none; min-width: 56px; font-size: 12px; text-align: right; color: var(--c-400); white-space: nowrap; }
button.find-button { flex: none; padding: 3px 8px; font-size: 12px; text-transform: none; background: none; border-color: transparent; color: var(--c-500); }
button.find-button:hover { background: var(--c-150); color: var(--c-700); }
button.find-button.on { background: var(--c-150); border-color: var(--accent); color: var(--c-700); }
.column .content:focus-within, .page .content:focus-within { border-color: var(--c-500); }
.column .content .spinner { flex: none; margin: auto; }
.column .message { margin-top: 8px; }
.column .message:empty { display: none; }
@media (max-width: 600px) {
    .columns { grid-template-columns: 1fr; gap: 16px; }
}
@media (min-width: 601px) {
    .columns { grid-template-columns: 1fr 1fr; transition: grid-template-columns 0.28s cubic-bezier(0.4, 0, 0.2, 1); }
    .columns[data-focus="short"] { grid-template-columns: 3fr 2fr; }
    .columns[data-focus="long"] { grid-template-columns: 2fr 3fr; }
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (max-width: 600px) {
    body { font-size: 14px; }
    h1 { font-size: 20px; letter-spacing: 1px; }
    .bar h1 { font-size: 16px; letter-spacing: 0.8px; }
    h2 { font-size: 14px; }
    input, .field textarea, .field .mirror, .field .marks { font-size: 16px; }
    button, a.button { padding: 7px 10px; font-size: 12px; }
    .bar { flex-wrap: wrap; gap: 6px 10px; padding: 10px; }
    .bar button, .bar a.button { padding: 6px 8px; font-size: 10px; }
    .bar h1 { flex: 1 1 120px; }
    .actions { gap: 6px; margin-left: auto; }
    main { padding: 16px 12px; }
    .card { padding: 16px; }
    .card h1 { margin-bottom: 16px; }
    .devices li { flex-wrap: wrap; }
    .devices .info { flex: 1 1 100%; }
    .item { min-height: 56px; padding: 12px; font-size: 14px; }
    .item.add { font-size: 18px; }
    .dialog .title { font-size: 18px; }
    .dialog button.info { padding: 12px 14px; font-size: 14px; }
    .clock { font-size: 22px; }
}

#knowledgeTiles .tile span:last-child { max-width: 100%; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#knowledgeTiles .tile .glyph { display: flex; }
.tile.add { border-style: dashed; color: var(--c-400); font-size: 32px; }
.page { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: var(--page-width); min-width: 0; }
.page-title { margin: 0; padding: 6px 12px; text-align: center; font-family: var(--font-retro); font-size: 22px; font-weight: 400; text-transform: uppercase; color: var(--c-700); }
.page > .message { min-height: 0; margin: 0; }
.page > .message:empty { display: none; }

.database { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dbody { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.database .search { margin: 0; }
.tabs { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tab-actions { display: flex; flex-shrink: 0; gap: 8px; }
.tabs button.add { padding: 7px 14px; font-size: 16px; line-height: 1; border-style: dashed; color: var(--c-400); }
.views { display: flex; flex-wrap: wrap; gap: 8px; }
button.tab { padding: 7px 12px; font-family: var(--font-main); font-size: 14px; text-transform: none; background: none; color: var(--c-500); }
button.tab:hover { background: var(--c-150); }
button.tab.active { background: var(--c-150); border-color: var(--accent); color: var(--c-700); }
button.settings { flex-shrink: 0; }
.note { margin: 0; color: var(--accent); font-size: 13px; }
.note:empty { display: none; }
.empty { margin: 0; text-align: center; font-size: 13px; color: var(--c-400); }

.table { background: var(--c-125); border: 1px solid var(--c-150); border-radius: 10px; overflow: hidden; }
.table .head, .table .row { display: grid; grid-template-columns: var(--cols); }
.table .head { position: relative; background: var(--c-075); font-family: var(--font-retro); font-size: 12px; text-transform: uppercase; color: var(--c-400); -webkit-user-select: none; user-select: none; }
.table .row { border-top: 1px solid var(--c-150); cursor: pointer; }
.table .row:hover { background: var(--c-150); }
.table .cell { min-width: 0; padding: 10px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-700); }
.table .head .cell { color: var(--c-400); text-align: center; }
.table .cell + .cell { border-left: 1px solid color-mix(in srgb, var(--c-700) 7%, transparent); }
.sentinel { height: 1px; margin-top: -1px; }
.pill { display: inline-block; max-width: 100%; padding: 1px 10px; overflow: hidden; vertical-align: middle; text-overflow: ellipsis; font-size: 13px; line-height: 1.5; border: 1px solid color-mix(in srgb, var(--pill) 45%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--pill) 18%, transparent); color: color-mix(in srgb, var(--pill) 70%, white); }

.inlines { display: flex; flex-direction: column; gap: 16px; }
.inline { min-width: 0; background: var(--c-125); border: 1px solid var(--c-150); border-radius: 10px; }
.inline .header { padding: 10px 12px; border-radius: 9px 9px 0 0; background: var(--c-150); cursor: pointer; -webkit-user-select: none; user-select: none; }
.inline .header:hover { background: var(--c-200); }
.inline .header .name { min-width: 0; padding: 6px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-retro); font-size: 16px; text-transform: uppercase; color: var(--c-700); }
.inline .dbody { padding: 12px; }
.inline.collapsed .header { border-radius: 9px; background: none; }
.inline.collapsed .header:hover { background: var(--c-150); }
.inline.collapsed .dbody { display: none; }

button.armed { background: var(--accent); border-color: var(--accent); color: var(--c-050); }
.dialog .line { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.dialog .line input { flex: 1; min-width: 0; }
.dialog .meta { color: var(--c-400); font-size: 13px; }
.dialog input.code { font-family: var(--font-main); font-size: 14px; }
.dialog select { flex: 1; min-width: 0; padding: 8px 10px; background: var(--c-050); color: var(--c-700); border: 1px solid var(--c-200); border-radius: 4px; font-family: var(--font-main); font-size: 14px; }
.dialog select:focus { outline: none; border-color: var(--c-500); }

.tabrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.panel { margin-top: 4px; }
.entries { display: flex; flex-direction: column; gap: 8px; }
.entry { background: var(--c-100); border: 1px solid var(--c-150); border-radius: 8px; }
.entry > .head { padding: 10px 12px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--c-700); cursor: pointer; -webkit-user-select: none; user-select: none; }
.entry > .head:hover { background: var(--c-150); }
.entry.open > .head { border-radius: 7px 7px 0 0; background: var(--c-150); }
.entry.open > .head:hover { background: var(--c-200); }
.entry > .body { display: none; padding: 4px 10px 12px; }
.entry.open > .body { display: block; }
.entry .type { font-family: var(--font-retro); font-size: 11px; text-transform: uppercase; color: var(--c-400); }
.entry .namerow { margin-top: 0; }
.entry .namerow button { padding: 6px 10px; font-size: 12px; }
.entry .namerow button.move { padding: 5px; line-height: 0; }
.entry .namerow button.move svg { width: 16px; height: 16px; }
.entry .namerow button.move:disabled { opacity: 0.35; cursor: default; }
.entry .namerow button.move:disabled:hover { background: var(--c-150); border-color: var(--c-250); }
.entry .label { margin: 14px 0 6px; }
.entry .section:first-child .label { margin-top: 6px; }
.entry .section + .section { margin-top: 12px; }
.options, .sorts { display: flex; flex-direction: column; gap: 6px; }
.option, .sort { padding: 6px 8px; background: var(--c-125); border: 1px solid var(--c-150); border-radius: 6px; }
.option.dragging, .sort.dragging { opacity: 0.6; border-color: var(--accent); }
.option .line, .sort .line { margin-top: 0; }
.option .line button:not(.swatch), .sort .line button { padding: 6px 10px; font-size: 12px; }
.grip { display: inline-flex; flex: none; cursor: grab; color: var(--c-400); touch-action: none; -webkit-user-select: none; user-select: none; }
.grip:active { cursor: grabbing; }
.grip svg { width: 18px; height: 18px; }
.swatch { flex: none; width: 28px; height: 28px; padding: 0; border: 2px solid var(--c-200); border-radius: 50%; }
.swatch:hover { border-color: var(--c-500); }
.swatch.on { border-color: var(--c-700); }
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-left: 26px; }
.swatches { display: flex; gap: 6px; }
.picker input.hex { flex: none; width: 110px; padding: 6px 8px; font-size: 13px; }
.sort .remove { padding: 6px; line-height: 0; }
.sort .remove svg { width: 14px; height: 14px; }
.widths { display: flex; flex-direction: column; gap: 6px; }
.width { display: flex; align-items: center; gap: 8px; }
.width span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--c-600); }
.width input.percent { flex: none; width: 80px; padding: 6px 8px; text-align: right; font-size: 13px; }
.width input.percent.auto { color: var(--c-400); font-style: italic; }
.entry .body > .section > .meta { margin: 0 0 8px; }
.entry .total { margin: 8px 0 0; font-size: 13px; color: var(--c-400); }
.entry .total.warn { color: var(--accent); }
.width .unit { color: var(--c-400); font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--font-main); font-size: 14px; text-transform: none; color: var(--c-600); cursor: pointer; }
.check input { flex: none; display: inline-block; width: auto; margin: 0; accent-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; font-family: var(--font-main); font-size: 14px; text-transform: none; border: 1px solid color-mix(in srgb, var(--pill) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--pill) 10%, transparent); color: color-mix(in srgb, var(--pill) 70%, white); }
.chip:not(.on) { opacity: 0.75; }
.chip:hover { border-color: var(--pill); background: color-mix(in srgb, var(--pill) 22%, transparent); opacity: 1; }
.chip.on { border-color: var(--pill); background: color-mix(in srgb, var(--pill) 50%, transparent); box-shadow: 0 0 0 1px var(--pill); color: var(--c-700); font-weight: 600; }
.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.pick { display: flex; align-items: center; justify-content: center; padding: 10px; line-height: 0; color: var(--c-500); }
.pick svg { width: 24px; height: 24px; }
.pick.on { border-color: var(--accent); color: var(--accent); }

.memo-tools { display: flex; gap: 12px; }
.memo-tools .search { flex: 1; min-width: 0; margin: 0; }
button.memo-restore { flex: none; padding: 0 14px; border-style: dashed; color: var(--c-400); font-size: 13px; }
button.memo-add { flex: none; padding: 0 20px; border-style: dashed; color: var(--c-400); font-size: 20px; line-height: 1; }
.memo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
a.memo { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; aspect-ratio: 1; min-width: 0; padding: 14px; background: var(--c-125); border: 1px solid var(--c-150); border-radius: 10px; color: var(--c-700); text-decoration: none; overflow: hidden; }
a.memo:hover { background: var(--c-150); border-color: var(--accent); }
a.memo:focus-visible { outline: none; background: var(--c-150); border-color: var(--accent); }
a.memo .name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; overflow-wrap: anywhere; font-size: 15px; line-height: 1.35; }
a.memo .date { font-size: 12px; color: var(--c-400); }
input.memo-title { margin: 0; padding: 6px 12px; text-align: center; font-family: var(--font-retro); font-size: 22px; text-transform: uppercase; color: var(--c-700); background: none; border: 1px solid transparent; border-radius: 6px; }
input.memo-title:hover { border-color: var(--c-150); }
input.memo-title:focus { background: var(--c-050); border-color: var(--c-500); }
.memo-foot { display: flex; justify-content: flex-end; }

@media (max-width: 600px) {
    .memo-list { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
    a.memo { padding: 10px; }
    a.memo .name { font-size: 13px; }
}
