:root { color-scheme: light; --ink: #242424; --muted: #858585; --line: #eaeaea; --soft: #f5f5f5; --danger: #bd3d3d; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: #fff; }
body { color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible { outline: 2px solid #767676; outline-offset: 2px; }
input:focus, textarea:focus { outline: 2px solid #bbb; outline-offset: 1px; }

.login-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(320px, 100%); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack input, .login-entry input, .enroll input { width: 100%; min-width: 0; height: 42px; border: 1px solid #ddd; border-radius: 8px; padding: 0 12px; background: #fff; font-size: 16px; }
.login-entry { display: flex; align-items: center; gap: 6px; }
.primary { height: 42px; border-radius: 8px; background: #2a2a2a; color: #fff; font-weight: 600; }
.link-button { display: block; margin: 12px auto 0; color: var(--muted); font-size: 13px; padding: 6px 10px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; color: #666; flex-shrink: 0; }
.text-button { height: 32px; padding: 0 10px; border-radius: 7px; color: #444; font-size: 13px; font-weight: 600; white-space: nowrap; }
@media (hover: hover) {
  .icon-button:hover:not(:disabled) { background: #efefef; color: #222; }
  .text-button:hover:not(:disabled) { background: #efefef; }
}
.form-error { color: var(--danger); font-size: 13px; line-height: 1.5; margin: 12px 0 0; text-align: center; }
.loader { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app { max-width: 720px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.bar { position: sticky; top: 0; z-index: 5; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; padding-top: env(safe-area-inset-top); box-sizing: content-box; background: #fff; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.bar-tools { display: flex; align-items: center; gap: 4px; }
.enroll { display: flex; gap: 6px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 1px solid #e2e2e2; border-radius: 8px; padding: 9px 11px; line-height: 1.45; min-height: 40px; max-height: 40vh; background: #fff; font-size: 16px; }
.app-error { text-align: left; padding: 0 20px; }
.list-head { display: flex; justify-content: flex-end; padding: 8px 12px 0; }
.list { list-style: none; margin: 0; padding: 4px 0; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 20px; border-bottom: 1px solid #f2f2f2; min-height: 56px; }
.origin { color: #9a9a9a; display: inline-flex; flex-shrink: 0; }
.body { flex: 1; min-width: 0; }
.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text { white-space: pre-wrap; word-break: break-word; line-height: 1.45; max-height: 7.3em; overflow: hidden; cursor: pointer; }
.text.open { max-height: none; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.actions { display: flex; align-items: center; flex-shrink: 0; }
.row progress { width: 100%; height: 4px; margin-top: 6px; appearance: none; border: 0; border-radius: 2px; background: #eee; overflow: hidden; }
.row progress::-webkit-progress-bar { background: #eee; }
.row progress::-webkit-progress-value { background: #555; }
.row progress::-moz-progress-bar { background: #555; }
.row.done .sub { color: #3c7a55; }
.empty { color: #aaa; text-align: center; font-size: 13px; padding: 40px 0; }
.drop { position: fixed; inset: 10px; border: 2px dashed #bbb; border-radius: 14px; background: rgba(255,255,255,.85); z-index: 20; pointer-events: none; }
