:root {
  --ink: #14211f; --muted: #687571; --paper: #f3f7f5; --surface: #fff; --line: #dce6e2;
  --green: #0b4b40; --green-2: #127260; --mint: #d8efe7; --amber: #c77b18; --red: #c4493d;
  font-family: "Yu Gothic UI", "Hiragino Sans", system-ui, sans-serif; color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 90% 0%, #d6ebe4 0, transparent 28rem), var(--paper); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 760px); min-height: 100vh; margin: auto; background: rgba(247,250,249,.86); box-shadow: 0 0 50px rgba(13,54,47,.08); padding-bottom: 88px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 5; }
.brand { border: 0; background: transparent; padding: 0; display: flex; align-items: center; gap: 10px; text-align: left; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: white; font-size: 1.2rem; font-weight: 800; transform: rotate(-2deg); }
.brand strong, .brand small { display: block; }.brand strong { font-size: 1rem; }.brand small { color: var(--muted); font-size: .69rem; margin-top: 2px; }
.icon-button, .close-button { border: 0; background: transparent; font-weight: 800; font-size: 1.3rem; color: var(--muted); padding: 10px; }
.connection-status { position:sticky; top:76px; z-index:4; padding:7px 16px; background:#8a5a12; color:white; text-align:center; font-size:.75rem; font-weight:800; letter-spacing:.04em; }
main { padding: 26px 22px 36px; }
.view { display: none; }.view.active { display: block; animation: enter .25s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.study-head, .section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.eyebrow { margin: 0 0 5px; color: var(--green-2); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.9rem, 7vw, 2.7rem); line-height: 1; letter-spacing: -.04em; } h1 small { font-size: .95rem; color: var(--muted); letter-spacing: 0; }
.ring { --progress: 0deg; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green-2) var(--progress), var(--line) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #f7faf9; }.ring span { position: relative; font-size: .75rem; font-weight: 800; }
.session-controls { display:grid; grid-template-columns:1fr 1fr auto; align-items:end; gap:9px; margin:-5px 0 16px; padding:12px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.72); }.session-controls label { margin:0; color:var(--muted); font-size:.7rem; }.session-controls select { width:100%; min-height:42px; margin-top:5px; padding:0 34px 0 11px; border:1px solid var(--line); border-radius:10px; background:white; color:var(--ink); font-weight:800; }.start-session-button { min-height:42px; padding:0 14px; border:0; border-radius:10px; background:var(--green); color:white; font-size:.78rem; font-weight:800; }
.study-card { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: clamp(22px, 6vw, 38px); box-shadow: 0 16px 40px rgba(13,62,52,.08); min-height: 470px; display: flex; flex-direction: column; }
.card-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .8rem; font-weight: 700; }.category-pill { color: var(--green); background: var(--mint); border-radius: 99px; padding: 6px 10px; }
.question-number { margin: 32px 0 10px; color: var(--green-2); font: 800 .7rem/1 system-ui; letter-spacing: .17em; }
.study-card h2 { margin: 0; font-size: clamp(1.3rem, 5.2vw, 1.85rem); line-height: 1.6; letter-spacing: -.025em; white-space: pre-line; }.answer-guide { color: var(--muted); font-size: .9rem; }
.reveal-button { margin-top: auto; border: 0; border-radius: 15px; min-height: 58px; padding: 0 20px; background: var(--green); color: white; display: flex; justify-content: space-between; align-items: center; font-weight: 800; box-shadow: 0 9px 20px rgba(11,75,64,.2); }
.answer-area { margin: 18px 0 22px; border-top: 1px solid var(--line); }.answer-item { display: flex; gap: 13px; padding: 15px 0; border-bottom: 1px solid var(--line); }.answer-item > span { flex: 0 0 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--green); color: white; font-size: .78rem; font-weight: 800; }.answer-item strong { color: var(--green); }.answer-item p { margin: 4px 0 0; line-height: 1.65; }.note { font-size: .76rem; color: var(--muted); line-height: 1.6; background: var(--paper); padding: 10px; border-radius: 10px; }
.memory-block { margin-top: 16px; padding: 16px; border-radius: 15px; background: #123d35; color: white; }.memory-block > span { display:block; margin-bottom:10px; color:#a9d7ca; font-size:.7rem; font-weight:800; letter-spacing:.12em; }.memory-block div { display:flex; flex-wrap:wrap; gap:7px; }.memory-block b { padding:7px 10px; border-radius:8px; background:rgba(255,255,255,.11); font-size:.85rem; }
.rating-panel { margin-top: auto; }.rating-panel > p { text-align: center; color: var(--muted); font-size: .82rem; }.rating-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }.rating { border: 1px solid var(--line); background: white; border-radius: 14px; padding: 11px 4px; font-size: .78rem; font-weight: 800; color: var(--ink); }.rating span,.rating small { display: block; }.rating span { font-size: 1.1rem; margin-bottom: 3px; }.rating small { color: var(--muted); font-size: .58rem; font-weight: 500; margin-top: 3px; }.rating.bad span{color:var(--red)}.rating.unsure span{color:var(--amber)}.rating.good{background:var(--green);color:white}.rating.good small,.rating.good span{color:white}
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%,760px); height: calc(72px + env(safe-area-inset-bottom)); padding: 8px 20px env(safe-area-inset-bottom); background: rgba(255,255,255,.94); border-top: 1px solid var(--line); backdrop-filter: blur(18px); display: grid; grid-template-columns: repeat(3,1fr); z-index: 10; }.nav-item { border: 0; background: transparent; color: var(--muted); font-size: .7rem; font-weight: 700; border-radius: 12px; }.nav-item span { display: block; font-size: 1.2rem; margin-bottom: 2px; }.nav-item.active { color: var(--green); background: var(--mint); }
.add-button,.primary-button,.secondary-button { border-radius: 13px; min-height: 46px; padding: 0 16px; font-weight: 800; }.add-button,.primary-button { border: 0; background: var(--green); color: white; }.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: none; }.filter-chip { white-space: nowrap; border: 1px solid var(--line); background: white; border-radius: 99px; padding: 9px 14px; color: var(--muted); }.filter-chip.active { background: var(--green); color: white; border-color: var(--green); }
.card-list { display: grid; gap: 12px; }.list-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; gap: 14px; justify-content: space-between; }.list-card h2 { font-size: 1rem; line-height: 1.55; margin: 6px 0 5px; }.list-card p { margin: 0; color: var(--muted); font-size: .78rem; }.list-card .list-path { margin-top:12px; color:var(--green-2); font-weight:800; }.list-actions { display: flex; flex-direction: column; gap: 8px; }.list-actions button { border: 0; background: var(--paper); color: var(--green); border-radius: 9px; padding: 8px; font-size: .72rem; }.list-actions button:last-child { color: var(--red); }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 18px; }.stat-card,.panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }.stat-card span,.stat-card strong,.stat-card small { display:block; }.stat-card span { color: var(--muted); font-size: .7rem; }.stat-card strong { font-size: 2rem; margin-top: 9px; }.stat-card small { color: var(--muted); }.panel h2 { margin: 0 0 20px; font-size: 1.05rem; }.progress-row { display: grid; grid-template-columns: minmax(110px,1fr) 2fr 42px; align-items: center; gap: 10px; margin: 16px 0; }.progress-row strong,.progress-row span { display:block; }.progress-row span { color:var(--muted); font-size:.7rem; margin-top:3px; }.progress-row b { font-size:.75rem; text-align:right; }.progress-track { height:8px; border-radius:99px; background:var(--line); overflow:hidden; }.progress-track i { display:block; height:100%; background:var(--green-2); border-radius:inherit; }
dialog { width: min(calc(100% - 28px), 650px); max-height: 88vh; border: 0; border-radius: 24px; padding: 24px; color: var(--ink); box-shadow: 0 30px 80px rgba(7,35,29,.3); }dialog::backdrop { background: rgba(4,28,23,.55); backdrop-filter: blur(3px); }.dialog-head { display:flex; justify-content:space-between; align-items:start; margin-bottom:20px; }.dialog-head h2 { margin:0; }.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }label { display:block; font-size:.8rem; font-weight:800; margin-bottom:15px; }input,textarea,select { display:block; width:100%; margin-top:7px; border:1px solid #cfdcd7; border-radius:11px; padding:12px; background:#fbfdfc; color:var(--ink); }textarea { resize:vertical; }input:focus,textarea:focus,select:focus { outline:3px solid rgba(18,114,96,.15); border-color:var(--green-2); }fieldset { border:0; padding:0; margin:4px 0; }legend { font-weight:800; font-size:.85rem; margin-bottom:10px; }legend small { color:var(--muted); font-weight:500; }.answer-input { display:grid; grid-template-columns: 1fr 2fr 32px; gap:7px; margin-bottom:8px; align-items:start; }.answer-input input,.answer-input textarea { margin:0; }.remove-answer { border:0;background:transparent;color:var(--red);font-size:1.1rem;padding:9px 0;}.text-button,.danger-link { border:0; background:transparent; padding:8px 0; color:var(--green-2); font-weight:800; }.danger-link { color:var(--red); margin-top:18px; }.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }.muted { color:var(--muted); line-height:1.6; }.settings-actions { display:grid; gap:9px; }.file-label { display:grid; place-items:center; margin:0; }.file-label input { display:none; }
.template-row { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin:0 0 12px; }.template-row > span { margin-right:auto; font-size:.8rem; font-weight:800; }.template-button { border:1px solid var(--line); background:var(--mint); color:var(--green); padding:7px 10px; border-radius:9px; font-size:.74rem; font-weight:800; }
.install-note { margin:16px 0; padding:14px; border-radius:13px; background:var(--mint); color:var(--green); font-size:.8rem; line-height:1.65; }
.toast { position:fixed; z-index:30; bottom:94px; left:50%; transform:translate(-50%,20px); background:#102e29;color:white;padding:12px 18px;border-radius:99px;opacity:0;pointer-events:none;transition:.2s;box-shadow:0 8px 30px rgba(0,0,0,.2);font-size:.84rem;}.toast.show{opacity:1;transform:translate(-50%,0)}.hidden{display:none!important}.empty-state,.empty-list{text-align:center;padding:50px 18px;color:var(--muted)}.empty-state h2{color:var(--ink)}.empty-icon{width:64px;height:64px;border-radius:20px;background:var(--mint);color:var(--green);display:grid;place-items:center;margin:auto;font-size:1.8rem}.empty-state .primary-button{margin-top:12px}
@media (max-width:540px){main{padding:20px 14px 30px}.topbar{padding-inline:15px}.session-controls{grid-template-columns:1fr 1fr}.start-session-button{grid-column:1 / -1}.study-card{border-radius:22px;min-height:calc(100vh - 250px)}.section-heading{align-items:end}.add-button{font-size:.76rem;padding-inline:12px}.form-grid{grid-template-columns:1fr}.answer-input{grid-template-columns:1fr 30px}.answer-input .answer-text{grid-column:1 / -1;grid-row:2}.answer-input .remove-answer{grid-column:2;grid-row:1}.list-card{padding:15px}.stats-grid{gap:6px}.stat-card{padding:13px 10px}.stat-card strong{font-size:1.65rem}}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
