:root{
  --bg:#f6f7f8;--surface:#ffffff;--surface2:#f3f4f6;--text:#202124;--muted:#74777c;
  --border:#e4e6e8;--accent:#fbbc04;--accent-strong:#e7aa00;--accent-text:#342800;
  --shadow:0 16px 42px rgba(28,31,35,.08);--radius:24px
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Roboto,Inter,system-ui,-apple-system,"Noto Sans JP",sans-serif;background:var(--bg);color:var(--text)}
body{transition:.22s background,.22s color}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
.brand{display:flex;align-items:center;gap:12px}.brand-icon{width:40px;height:40px;border-radius:13px;background:var(--accent);display:grid;place-items:center;font-size:20px;color:#3a2d00;box-shadow:inset 0 -1px 0 rgba(0,0,0,.08)}
.brand h1{font-size:18px;margin:0;font-weight:700;letter-spacing:-.01em}.brand p{font-size:12px;color:var(--muted);margin:2px 0 0}
.icon-btn,.android-icon{border:0;background:transparent;color:inherit}.icon-btn{width:42px;height:42px;border-radius:50%;font-size:24px}.icon-btn:hover{background:var(--surface2)}
.layout{max-width:1240px;margin:auto;padding:28px 22px 60px;display:grid;grid-template-columns:minmax(330px,500px) minmax(330px,1fr);gap:50px;align-items:start}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:28px}
.preview-title{display:flex;align-items:center;justify-content:space-between}
.eyebrow{font-size:10px;letter-spacing:.15em;font-weight:800;color:var(--muted)}
.text-btn{border:0;background:transparent;color:var(--muted);padding:9px 11px;border-radius:10px}.text-btn:hover{background:var(--surface2)}.danger-soft:hover{color:#c33}
label{display:block;margin:0 0 18px}label>span{display:block;font-size:12px;font-weight:750;color:var(--muted);margin:0 0 8px}label small{font-size:10px;font-weight:600;opacity:.8}
input,textarea,select{width:100%;border:1px solid var(--border);background:var(--surface2);color:var(--text);outline:0;border-radius:15px;padding:13px 14px;transition:.2s}
input:focus,textarea:focus,select:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 22%,transparent)}
textarea{height:230px;resize:vertical;line-height:1.65}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.actions{display:grid;grid-template-columns:1.15fr .85fr;gap:10px}
.primary-btn,.secondary-btn{height:50px;border-radius:16px;font-weight:780;border:0;display:flex;align-items:center;justify-content:center;gap:9px}
.primary-btn{background:var(--accent);color:var(--accent-text);box-shadow:0 5px 16px color-mix(in srgb,var(--accent) 25%,transparent)}.primary-btn:hover{background:var(--accent-strong)}
.secondary-btn{background:var(--surface2);color:var(--text);border:1px solid var(--border)}.secondary-btn:hover{background:color-mix(in srgb,var(--surface2) 78%,var(--accent) 22%)}
.status{min-height:18px;font-size:12px;color:var(--muted);margin:12px 3px 0}
.preview-wrap{display:flex;flex-direction:column;align-items:center}.preview-title{width:min(100%,390px);font-size:11px;color:var(--muted);margin:0 0 12px}
.phone{width:min(100%,390px);aspect-ratio:1080/2400;background:#050505;padding:9px;border-radius:45px;box-shadow:0 30px 72px rgba(0,0,0,.24)}
.phone-screen{height:100%;position:relative;overflow:hidden;border-radius:37px;background:#fff8e1;color:#202124;display:flex;flex-direction:column}
.phone-screen.device-dark{background:#202124!important;color:#e8eaed!important}
.phone-screen.device-dark .note-footer{color:#bdc1c6!important}
.phone-screen.device-dark .gesture-bar{background:#e8eaed}
.statusbar{height:36px;display:flex;align-items:center;justify-content:space-between;padding:0 22px;font-size:11px;font-weight:650}
.status-icons{display:flex;align-items:center;gap:7px}.battery{width:17px;height:9px;border:1.5px solid currentColor;border-radius:2px;position:relative}.battery:after{content:"";position:absolute;left:2px;right:2px;top:2px;bottom:2px;background:currentColor}.battery:before{content:"";position:absolute;right:-3px;top:2px;width:2px;height:4px;background:currentColor}
.keep-appbar{height:54px;display:flex;align-items:center;padding:0 10px}.android-icon{width:42px;height:42px;border-radius:50%;font-size:27px}.spacer{flex:1}
.note{padding:20px 28px 10px;overflow:hidden}.note h3{font-size:23px;line-height:1.3;margin:0 0 18px;font-weight:500;white-space:pre-wrap;overflow-wrap:anywhere}
.note-body{font-size:17px;line-height:1.55;white-space:normal;overflow-wrap:anywhere}.note-line{display:flex;align-items:flex-start;gap:9px;margin:0 0 7px}.note-line.plain{display:block;white-space:pre-wrap}.md-bullet{width:7px;height:7px;border-radius:50%;background:currentColor;margin-top:.57em;flex:0 0 auto}.md-num{min-width:22px}.md-check{width:17px;height:17px;border:1.8px solid currentColor;border-radius:3px;margin-top:.16em;display:grid;place-items:center;flex:0 0 auto}.md-check.checked:after{content:"✓";font-size:13px;font-weight:800;line-height:1}
.note-footer{height:52px;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 10px 24px;font-size:10px;color:#6f6252;margin-top:auto}
.gesture-bar{position:absolute;bottom:7px;left:50%;transform:translateX(-50%);width:110px;height:4px;background:currentColor;border-radius:5px;opacity:.75}
@media(max-width:850px){.layout{grid-template-columns:1fr;gap:34px}.editor{max-width:620px;margin:auto;width:100%}.topbar{padding:0 18px}}
@media(max-width:480px){.layout{padding:16px 12px 45px}.card{padding:20px;border-radius:22px}.grid2,.actions{grid-template-columns:1fr}.phone{border-radius:38px}.phone-screen{border-radius:31px}.editor-top{flex-direction:column}.editor-menu{width:100%;justify-content:flex-start}.editor-menu-btn{flex:1}}

.insert-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:-6px 0 12px}
.insert-btn{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:12px;padding:8px 10px;font-size:11px;font-weight:700;display:inline-flex;align-items:center;gap:7px}
.insert-btn:hover{background:var(--surface2);border-color:color-mix(in srgb,var(--border) 70%,var(--accent) 30%)}
.insert-icon{min-width:18px;text-align:center;font-size:13px}

.editor-top{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:24px}
.editor-top h2{margin:3px 0 0;font-size:24px}
.editor-menu{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.editor-menu-btn{border:1px solid var(--border);background:var(--surface2);color:var(--text);border-radius:13px;padding:9px 11px;display:flex;align-items:center;gap:8px;min-width:108px;text-align:left}
.editor-menu-btn:hover{background:color-mix(in srgb,var(--surface2) 80%,var(--accent) 20%)}
.editor-menu-icon{width:24px;height:24px;display:grid;place-items:center;border-radius:8px;background:var(--surface);font-weight:800}
.editor-menu-btn strong{display:block;font-size:11px;line-height:1.15}
.editor-menu-btn small{display:block;font-size:9px;color:var(--muted);margin-top:2px}

@media(min-width:851px){
  .editor-top{align-items:center}
  .editor-menu-btn{min-width:114px}
}

.preview-tools{display:flex;align-items:center;gap:10px}
.phone{transition:aspect-ratio .22s ease,height .22s ease}

.phone{overflow:hidden;display:flex;align-items:stretch;justify-content:stretch}
#previewCanvas{display:block;width:100%;height:100%;border-radius:36px;background:#fff8e1}


.status-controls{display:grid;gap:14px;padding:14px;border:1px solid var(--border);background:var(--surface2);border-radius:16px;margin-bottom:20px}
.status-control-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.status-control{display:grid;gap:7px;margin:0}
.control-head{display:flex;align-items:center;justify-content:space-between;font-size:11px}
.control-head span{font-weight:700;color:var(--muted)}
.control-head strong{font-size:11px;color:var(--text)}
.status-control input[type="range"]{width:100%;padding:0;margin:0;border:0;background:transparent;box-shadow:none;accent-color:var(--accent-strong)}
.network-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.network-row>span{font-size:11px;font-weight:700;color:var(--muted)}
.segmented{display:flex;gap:4px;padding:4px;background:var(--surface);border:1px solid var(--border);border-radius:12px}
.network-btn{border:0;background:transparent;color:var(--muted);padding:7px 10px;border-radius:8px;font-size:10px;font-weight:800}
.network-btn.active{background:var(--accent);color:var(--accent-text)}
@media(max-width:480px){
  .status-control-grid{grid-template-columns:1fr}
  .network-row{align-items:flex-start;flex-direction:column}
  .segmented{width:100%}
  .network-btn{flex:1}
}

#previewCanvas{min-height:420px}

.display-settings{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px;border:1px solid var(--border);background:var(--surface2);border-radius:16px;margin:-8px 0 20px}
.setting-title{display:block;font-size:11px;font-weight:800}.setting-copy small{display:block;font-size:9px;color:var(--muted);margin-top:3px}
.toggle-row{display:flex;gap:8px}
.switch-item{display:flex;align-items:center;gap:7px;margin:0;padding:7px 9px;background:var(--surface);border:1px solid var(--border);border-radius:11px;font-size:10px;font-weight:750}
.switch-item input{position:absolute;opacity:0;pointer-events:none}
.switch-item i{width:28px;height:16px;border-radius:999px;background:#c9cdd1;position:relative;transition:.18s}
.switch-item i:after{content:"";position:absolute;width:12px;height:12px;left:2px;top:2px;border-radius:50%;background:#fff;transition:.18s;box-shadow:0 1px 3px rgba(0,0,0,.18)}
.switch-item input:checked+i{background:var(--accent-strong)}
.switch-item input:checked+i:after{transform:translateX(12px)}
.status-controls{margin-bottom:16px}
.editor-top{margin-bottom:18px}
.insert-toolbar{padding-top:2px}
@media(max-width:520px){
  .display-settings{align-items:flex-start;flex-direction:column}
  .toggle-row{width:100%}.switch-item{flex:1;justify-content:space-between}
}

.display-settings{display:grid;grid-template-columns:1fr;gap:12px}
.display-settings .setting-copy{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.toggle-row{justify-content:flex-start}
.trim-setting{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0;padding:10px 11px;background:var(--surface);border:1px solid var(--border);border-radius:12px}
.trim-setting>div span{display:block;font-size:10px;font-weight:800}
.trim-setting>div small{display:block;font-size:9px;color:var(--muted);margin-top:2px}
.trim-setting input{position:absolute;opacity:0;pointer-events:none}
.trim-setting i{width:34px;height:20px;border-radius:999px;background:#c9cdd1;position:relative;transition:.18s;flex:0 0 auto}
.trim-setting i:after{content:"";position:absolute;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background:#fff;transition:.18s;box-shadow:0 1px 3px rgba(0,0,0,.18)}
.trim-setting input:checked+i{background:var(--accent-strong)}
.trim-setting input:checked+i:after{transform:translateX(14px)}
.preview-tools{display:flex;align-items:center;justify-content:flex-end}

.note-field>.insert-toolbar{margin:0 0 8px;padding:0;gap:6px}
.note-field>.insert-toolbar .insert-btn{padding:7px 9px;border-radius:10px;font-size:10px}
.note-field>textarea{margin-top:0}

/* v19 Android-like UI polish */
body{background:#f5f6f7}
.layout{gap:36px;padding-top:24px}
.card{border-radius:22px;box-shadow:0 8px 28px rgba(28,31,35,.07);padding:24px}
.editor-top{align-items:center;margin-bottom:16px}
.editor-top h2{font-size:22px;letter-spacing:-.02em}
.editor-menu{gap:6px}
.editor-menu-btn{min-width:auto;padding:8px 10px;border-radius:12px;background:#f7f8f9}
.editor-menu-icon{background:#fff}
.status-controls,.display-settings{background:#f8f9fa;border-radius:14px;border-color:#e4e7ea}
.status-controls{padding:13px}
.display-settings{margin-top:-4px}
.setting-title{font-size:11px}
.switch-item{background:#fff;border-radius:10px}
.trim-setting{background:#fff;border-radius:10px}
input,textarea,select{background:#f7f8f9;border-radius:13px}
textarea{height:224px}
.insert-toolbar{gap:6px}
.insert-btn{background:#fff;border-radius:10px}
.actions{gap:8px}
.primary-btn,.secondary-btn{height:48px;border-radius:14px}
.preview-title{margin-bottom:10px}
.phone{border-radius:42px;padding:8px;box-shadow:0 22px 56px rgba(0,0,0,.2)}
#previewCanvas{border-radius:34px}
@media(max-width:850px){
  .layout{gap:28px}
}

.preview-title{padding:0 2px}
.phone{margin-top:2px}
