:root{color-scheme:light;--bg:#f3f6fb;--panel:#fff;--subtle:#f8fafc;--text:#17212f;--muted:#475569;--border:#cbd5e1;--accent:#1d4ed8;--focus:#2563eb;--danger:#b42318;font-family:system-ui,sans-serif}*{box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%}body{margin:0;background:var(--bg);color:var(--text);line-height:1.5}.app{width:min(100% - 2rem,760px);margin:clamp(1rem,4vw,3rem) auto;padding:clamp(1rem,3vw,2rem);background:var(--panel);border:1px solid var(--border);border-radius:16px;box-shadow:0 6px 24px #0f172a0a}header,.editor-actions,.history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem}header{margin-bottom:1.75rem}h1{margin:0;font-size:clamp(1.35rem,1.1rem + 1vw,1.75rem);line-height:1.2;letter-spacing:-.02em}header p{margin:.35rem 0 0;color:var(--muted);font-size:.875rem}label{font-weight:600}.editor-section>label{display:block;margin-bottom:.625rem}textarea{display:block;width:100%;min-height:clamp(17rem,48vh,28rem);padding:1rem;border:1px solid var(--border);border-radius:12px;background:var(--panel);color:var(--text);font:400 1.0625rem/1.65 system-ui,sans-serif;resize:vertical;overflow-wrap:anywhere;outline:none}textarea::placeholder{color:var(--muted)}textarea:focus{border-color:var(--focus);box-shadow:0 0 0 3px #2563eb33}button{font:inherit;font-size:.9375rem;font-weight:600;min-height:44px;padding:.625rem 1rem;border:1px solid var(--border);border-radius:9px;background:var(--panel);color:var(--text);cursor:pointer;white-space:nowrap;transition:background-color .12s ease,border-color .12s ease}button:hover:not(:disabled){background:var(--subtle)}button:focus-visible,input:focus-visible{outline:3px solid var(--focus);outline-offset:3px}button:disabled{opacity:.5;cursor:not-allowed}.primary{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.primary:hover:not(:disabled){background:#1e40af}.danger{color:var(--danger)}.editor-actions{margin-top:.875rem;flex-wrap:wrap}.buttons{display:flex;gap:.625rem}#count,.usage{font-size:.875rem;color:var(--muted)}#mode{border-color:var(--accent);color:var(--accent)}#mode[aria-pressed=false]{border-color:var(--border);color:var(--muted)}.history-section{border-top:1px solid var(--border);margin-top:1.75rem;padding-top:1.5rem}.history-toolbar{margin-bottom:1rem;flex-wrap:wrap;align-items:flex-start}.history-controls{display:flex;flex:1 1 280px;min-width:0;flex-direction:column;gap:.4rem}.search-label{font-size:.875rem;color:var(--muted)}#history-search{display:block;width:100%;max-width:28rem;min-height:44px;padding:.625rem .75rem;border:1px solid var(--border);border-radius:9px;background:var(--panel);color:var(--text);font:inherit;font-size:1rem}#history-search:focus{outline:3px solid var(--focus);outline-offset:2px}.toggle{display:flex;align-items:center;gap:.625rem;min-height:44px;cursor:pointer;font-size:.9375rem}.toggle input{width:20px;height:20px;margin:0;accent-color:var(--accent)}.usage{margin-bottom:.75rem}.history-list{display:flex;flex-direction:column;gap:.75rem}.history-item{display:flex;align-items:flex-start;gap:1rem;padding:1rem;border:1px solid var(--border);border-radius:12px;background:var(--subtle)}.history-body{flex:1;min-width:0}.history-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:1rem;line-height:1.55}.history-text.collapsed{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.history-date{font-size:.8125rem;color:var(--muted);margin-top:.5rem}.history-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:.5rem}.history-actions button{min-height:44px;padding:.5rem .875rem;font-size:.875rem}.expand{min-height:44px;border:0;padding:.5rem 0;color:var(--accent);background:transparent}#notice{min-height:1.5rem;font-size:.875rem;color:var(--muted)}#notice.error{color:var(--danger)}[hidden]{display:none!important}@media(max-width:640px){.app{width:100%;min-height:100dvh;margin:0;border:0;border-radius:0;box-shadow:none;padding:1rem}header{margin-bottom:1.25rem}textarea{min-height:40vh;font-size:1rem}.history-item{flex-direction:column}.history-actions{width:100%;justify-content:flex-end}.history-toolbar{gap:.625rem}.history-toolbar>button{font-size:.875rem}}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--bg:#0e1522;--panel:#17212f;--subtle:#202e40;--text:#f1f5f9;--muted:#b7c4d6;--border:#516076;--accent:#9bc0ff;--focus:#9bc0ff;--danger:#ffaba5}.primary{background:#2563eb;border-color:#2563eb;color:#fff}.primary:hover:not(:disabled){background:#1d4ed8}textarea:focus{box-shadow:0 0 0 3px #9bc0ff33}}@media(prefers-reduced-motion:reduce){button{transition:none}}
