:root { --ink:#17202a; --muted:#6b7280; --line:#d8dee6; --blue:#2563eb; --paper:#fff; --bg:#eef1f5; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; padding-bottom:76px; }
.lock-screen { position:fixed; inset:0; z-index:20; display:flex; align-items:center; justify-content:center; padding:24px; background:linear-gradient(145deg,#17202a,#26384a); }
.lock-card { width:min(100%,360px); padding:28px 22px; border-radius:16px; background:white; text-align:center; box-shadow:0 12px 50px #0005; }
.lock-mark { width:48px; height:48px; margin:0 auto 12px; border-radius:50%; background:var(--blue); color:white; display:grid; place-items:center; font-size:26px; font-weight:800; }
.lock-card h2 { margin:0 0 8px; } .lock-card p { color:var(--muted); font-size:13px; line-height:1.4; }
.lock-card input { width:100%; min-height:44px; padding:10px; border:1px solid var(--line); border-radius:8px; font:inherit; margin:8px 0; text-align:center; }
.lock-card button { width:100%; text-align:center; margin-top:4px; } .lock-error { color:#b3261e; font-size:12px; min-height:18px; margin-top:8px; }
.topbar { position:sticky; top:0; z-index:5; display:flex; justify-content:space-between; align-items:center; padding:12px 16px; background:var(--ink); color:white; padding-top:calc(12px + env(safe-area-inset-top)); }
h1 { font-size:18px; margin:0; } #saveState { font-size:11px; opacity:.7; }
button { border:1px solid var(--line); border-radius:8px; background:white; color:var(--ink); min-height:40px; padding:8px 10px; font:inherit; cursor:pointer; }
.top-actions button { border:0; background:transparent; color:white; font-size:24px; padding:3px 8px; }
main { max-width:800px; margin:auto; padding:16px 12px 24px; }
.title { width:100%; border:0; border-bottom:1px solid var(--line); background:transparent; font-size:24px; font-weight:700; padding:4px 2px 12px; outline:0; }
.modes { display:flex; gap:8px; margin:14px 0 4px; }
.mode { flex:1; font-size:13px; } .mode.active { background:var(--ink); color:white; border-color:var(--ink); }
.toolbar { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; margin:14px 0 8px; }
.toolbar button { font-size:12px; min-height:38px; }
.toolbar button.active { background:var(--blue); color:white; border-color:var(--blue); }
.hint { color:var(--muted); font-size:12px; margin:10px 2px; }
footer { max-width:700px; margin:20px auto 0; color:var(--muted); font-size:10px; line-height:1.4; text-align:center; }
#editor { min-height:65vh; background:var(--paper); max-width:700px; margin:14px auto; padding:48px 7.5%; box-shadow:0 2px 12px #17202a18; font-family:"Courier New",monospace; font-size:12pt; line-height:1.05; outline:0; }
#editor p { min-height:1.15em; margin:0; white-space:pre-wrap; }
#editor p[data-type="scene"] { font-weight:700; margin-top:12px; margin-bottom:6px; text-transform:uppercase; }
#editor p[data-type="character"] { font-weight:700; margin-top:12px; margin-left:31%; text-transform:uppercase; }
#editor p[data-type="dialogue"] { margin-left:14%; margin-right:14%; }
#editor p[data-type="parenthetical"] { margin-left:23%; margin-right:26%; font-style:italic; }
#editor p[data-type="transition"] { text-align:right; font-weight:700; margin-top:12px; text-transform:uppercase; }
.project-tabs { display:grid; grid-template-columns:repeat(2,1fr); gap:7px; margin:14px 0; }
.project-tabs button { text-align:left; font-size:12px; min-height:44px; }
.project-tabs button.active { background:var(--blue); color:white; border-color:var(--blue); }
.project-card { background:var(--paper); padding:18px; box-shadow:0 2px 12px #17202a18; }
.project-card label { display:block; font-size:18px; font-weight:700; margin-bottom:10px; }
.project-card textarea { width:100%; min-height:46vh; border:1px solid var(--line); border-radius:7px; resize:vertical; padding:12px; font:15px/1.55 system-ui,sans-serif; outline-color:var(--blue); }
.project-card small { display:block; color:var(--muted); margin-top:8px; line-height:1.4; }
.bottom-bar { position:fixed; z-index:5; bottom:0; left:0; right:0; display:flex; gap:8px; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); background:white; border-top:1px solid var(--line); }
.bottom-bar button { flex:1; } .bottom-bar .primary { background:var(--blue); color:white; border-color:var(--blue); }
#toast { position:fixed; left:50%; bottom:84px; transform:translateX(-50%); background:var(--ink); color:white; border-radius:20px; padding:9px 14px; font-size:13px; opacity:0; pointer-events:none; transition:opacity .2s; }
#toast.show { opacity:1; }
@media (min-width:700px) { .toolbar { grid-template-columns:repeat(6,1fr); } }
