:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif; color: #333b36; background: #fff; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #dce0dc; border-radius: 7px; padding: 9px 12px; background: #fff; color: #444e47; min-height: 42px; }
button:hover { background: #edf0ec; }
button:focus-visible, input:focus-visible { outline: 2px solid #879d8d; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .6; }
.primary { background: #46564b; border-color: #46564b; color: white; }
.primary:hover { background: #35463a; }
input { border: 1px solid #dce0dc; border-radius: 7px; padding: 10px 12px; width: 100%; background: #fff; font-size: 16px; }
.brand { font-size: 17px; font-weight: 600; letter-spacing: -.4px; display: flex; align-items: center; gap: 9px; }
.brand-mark { color: #7f8c81; font-size: 26px; font-weight: 400; }
.hint, small, .private-label { font-size: 12px; color: #7a827c; line-height: 1.8; }
.login-panel { max-width: 410px; margin: 14vh auto; padding: 28px; }
.login-panel h1 { font-size: 22px; font-weight: 500; margin-top: 40px; }
.login-panel p { color: #778078; line-height: 1.8; }
.login-panel form { display: grid; gap: 12px; margin: 32px 0 18px; }
.login-panel label { font-size: 13px; }
#workspace { display: grid; grid-template-columns: 292px minmax(0, 1fr); height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 16px; padding: 24px 18px 14px; background: #f7f8f6; border-right: 1px solid #e6e9e4; min-height: 0; }
.sidebar header { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 14px; }
.search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.filters { display: flex; gap: 6px; }
.filters button { flex: 1; border: 0; background: transparent; color: #788078; }
.filters button[aria-pressed="true"] { color: #344c3c; background: #e9ede7; }
.note-list { flex: 1; overflow-y: auto; min-height: 0; }
.note-item { display: block; text-align: left; width: 100%; border: 0; background: transparent; border-radius: 7px; margin-bottom: 5px; padding: 13px 12px; }
.note-item[aria-current="true"] { background: #e9ede7; }
.note-body { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; font-weight: 400; line-height: 1.8; }
.note-body::first-line { font-size: 14px; font-weight: 400; }
.note-item small { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.backup-actions button { font-size: 12px; flex: 1; background: transparent; padding: 8px 6px; white-space: nowrap; }
.editor-panel { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 28px; min-height: 76px; border-bottom: 1px solid #f0f1ee; }
#save-status { font-size: 12px; color: #758176; margin-right: auto; }
#note-actions { display: flex; gap: 6px; }
#note-actions button { font-size: 12px; border-color: transparent; background: #f7f8f6; }
#sync-now, #reauth { font-size: 12px; padding: 6px 10px; border-color: transparent; }
dialog { max-width: min(440px, calc(100% - 32px)); padding: 26px; border: 1px solid #dce0dc; border-radius: 12px; color: #354038; }
dialog::backdrop { background: #18221c66; }
dialog h2 { font-size: 18px; font-weight: 500; } dialog p { font-size: 14px; line-height: 1.8; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
#editor { width: 100%; flex: 1; min-height: 180px; padding: 30px max(28px, calc((100% - 800px) / 2)); border: 0; outline: 0; resize: none; color: #354038; background: #fff; font-family: inherit; font-size: 16px; font-weight: 400; line-height: 1.85; letter-spacing: 0; border-radius: 0; }
#editor::first-line { font-size: 16px; font-weight: 400; }
#editor::placeholder { color: #a1a8a1; }
#preview { padding: 24px max(28px, calc((100% - 800px) / 2)); overflow: auto; line-height: 1.85; font-size: 16px; overflow-wrap: anywhere; }
#preview h1 { font-size: 24px; } #preview h2 { font-size: 21px; } #preview h3 { font-size: 18px; }
#preview pre { overflow-x: auto; padding: 16px; background: #f5f7f4; border-radius: 6px; }
#preview blockquote { border-left: 3px solid #b8c6b6; margin-left: 0; padding-left: 18px; color: #758176; }
#preview table { border-collapse: collapse; display: block; overflow-x: auto; }
#preview td, #preview th { border: 1px solid #dce0dc; padding: 8px 12px; }
#preview a { color: #466b53; }
.back { display: none; }
.empty-state { margin: auto; padding: 30px; text-align: center; color: #818d82; }
.empty-state > span { font-size: 36px; color: #b3bdb3; }
#message { position: fixed; z-index: 10; bottom: 18px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); padding: 14px 18px; border-radius: 8px; background: #39493d; color: #fff; font-size: 14px; box-shadow: 0 4px 20px #0002; }
@media (max-width: 680px) {
  #workspace { display: block; }
  .sidebar, .editor-panel { height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
  .sidebar { border: 0; padding-top: max(20px, env(safe-area-inset-top)); }
  .editor-panel { display: none; }
  #workspace.editing .sidebar { display: none; }
  #workspace.editing .editor-panel { display: flex; }
  .back { display: inline-block; border: 0; }
  .editor-toolbar { padding: max(8px, env(safe-area-inset-top)) 12px 8px; min-height: 64px; gap: 8px; }
  #editor { padding: 18px 22px; font-size: 16px; font-weight: 400; }
  #note-actions { margin-left: auto; }
}
