:root{--bg:#fff7ed;--card:#fffbf5;--line:#fed7aa;--text:#1f2937;--muted:#6b7280;--accent:#c2410c;--accent-hover:#9a3412;--focus-ring:rgba(194,65,12,.25);--radius:12px;--shadow:0 1px 2px rgba(146,64,14,.08);--gutter-width:clamp(44px,5ch,56px);--header-height:60px}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:"Inter","Noto Sans JP",system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text)}
html.is-mobile-layout,body.is-mobile-layout{max-width:100%;overflow-x:hidden}
main{max-width:1440px;margin:0 auto;padding:12px 16px 16px;height:calc(100dvh - var(--header-height));min-height:calc(100svh - var(--header-height));min-height:calc(100dvh - var(--header-height));display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:8;height:var(--header-height);display:flex;justify-content:space-between;align-items:center;padding:0 16px;background:rgba(255,247,237,.92);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.topbar h1{margin:0;font-size:18px;font-weight:700}.topbar-left,.topbar-right{display:flex;gap:10px;align-items:center;color:var(--muted)}
.topbar-left{min-width:0}
#loginUser{max-width:240px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar h1{display:flex;align-items:center;gap:8px;line-height:1}
.pomodoro-alert-box{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:14px;font-weight:700;color:var(--accent-hover);white-space:nowrap;display:none;pointer-events:none;z-index:20}
.pomodoro-alert{animation:slowBlink 2s infinite}
.app-title-logo{height:2em;width:auto;display:block;object-fit:contain;flex:0 0 auto}
.topbar-right{position:relative}
.guest-mode-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:12px;line-height:1.4;font-weight:600;color:#9a3412;background:#ffedd5;border:1px solid #fdba74;white-space:nowrap}
.hamburger-wrap{position:relative}
.header-menu-popup{position:absolute;top:36px;right:0;z-index:20;min-width:0;width:fit-content;max-width:calc(100vw - 24px);background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 18px rgba(15,23,42,.12);padding:6px}
.header-menu-item{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  box-sizing:border-box;
  text-align:left;
  border:0;
  background:transparent;
  padding:10px 12px;
  border-radius:8px;
  white-space:nowrap;
  font:inherit;
  font-size:14px;
  font-weight:600;
  line-height:1.4;
  color:var(--text);
  text-decoration:none;
  appearance:none;
}
.header-menu-item:hover{background:#fff7ed}
.header-menu-item-danger{color:#b91c1c}
.header-menu-item-danger:hover{background:#fef2f2;color:#991b1b}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);transition:box-shadow .2s ease}.card:hover{box-shadow:0 10px 24px rgba(194,65,12,.12)}
.hidden{display:none!important}
.boot-splash{display:none}
body.boot-checking .boot-splash{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;height:calc(100dvh - var(--header-height));color:var(--muted);font-size:13px}
body.boot-checking #landingPageRoot,body.boot-checking #loginSection,body.boot-checking #appSection{display:none!important}
.boot-splash-logo{height:56px;width:auto;object-fit:contain}
#loginSection{max-width:380px;margin:64px auto;padding:20px;display:grid;gap:14px}
#registerSection{max-width:380px;margin:64px auto;padding:20px;display:grid;gap:14px}
#passwordResetSection{max-width:380px;margin:64px auto;padding:20px;display:grid;gap:14px}
#verifyEmailSection{max-width:380px;margin:64px auto;padding:20px;display:grid;gap:14px}
.lp-root{width:100%;padding:32px 0 56px}
.lp-shell{max-width:1120px;margin:0 auto;display:grid;gap:56px}
.lp-hero{padding:12px 0 4px}
.lp-hero-inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(450px,590px);gap:34px;align-items:center}
.lp-hero-copy{display:grid;gap:18px;max-width:520px}
.lp-eyebrow,.lp-section-label{margin:0;font-size:13px;font-weight:700;letter-spacing:.08em;color:var(--accent);text-transform:uppercase}
.lp-title,.lp-section-title,.lp-cta-title{margin:0;font-size:clamp(38px,5vw,58px);line-height:1.02;font-weight:700;letter-spacing:-.03em;color:#111827}
.lp-description,.lp-cta-copy{margin:0;font-size:17px;line-height:1.75;color:#4b5563}
.lp-note{margin:0;font-size:13px;line-height:1.7;color:#6b7280}
.lp-actions{display:flex;flex-wrap:wrap;gap:12px}
.lp-primary-btn,.lp-secondary-btn{min-height:46px;padding:0 20px;border-radius:12px}
.lp-primary-btn{background:var(--accent);border-color:var(--accent);color:#fff}
.lp-primary-btn:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.lp-secondary-btn{background:#fff;color:var(--text)}
.lp-section{display:grid;gap:22px}
.lp-section-head{display:grid;gap:8px;max-width:760px}
.lp-section-title{font-size:clamp(28px,3.4vw,40px);line-height:1.15;letter-spacing:-.025em}
.lp-feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.lp-feature-card,.lp-screen-card,.lp-cta{background:rgba(255,255,255,.74);border:1px solid rgba(254,215,170,.58);border-radius:20px;box-shadow:0 14px 36px rgba(146,64,14,.06)}
.lp-feature-card{padding:20px 18px;display:grid;gap:10px}
.lp-feature-card h4,.lp-screen-copy h4{margin:0;font-size:18px;line-height:1.3}
.lp-feature-card p,.lp-screen-copy p{margin:0;font-size:14px;line-height:1.7;color:#6b7280}
.lp-screen-showcase{display:grid;gap:18px}
.lp-screen-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.lp-screen-card{padding:16px;display:grid;gap:12px}
.lp-screen-card-main{grid-template-rows:auto minmax(0,1fr)}
.lp-screen-card-side{grid-template-rows:auto minmax(0,1fr);height:100%}
.lp-screen-copy{display:grid;gap:6px}
.lp-screen-media{position:relative;overflow:hidden;border-radius:16px;background:linear-gradient(180deg,#fff 0%,#fff9f2 100%);border:1px solid rgba(254,215,170,.5)}
.lp-screen-media::after{content:"";position:absolute;inset:auto 0 0 0;height:22%;background:linear-gradient(180deg,rgba(255,251,245,0) 0%,rgba(255,251,245,.72) 100%);pointer-events:none}
.lp-screen-image{display:block;width:100%;height:100%;object-fit:cover}
.lp-screen-placeholder{display:none;position:absolute;inset:0;align-content:end;gap:8px;padding:20px;background:
  radial-gradient(circle at top right,rgba(251,146,60,.14),transparent 36%),
  linear-gradient(180deg,#fffaf3 0%,#fff 100%)}
.lp-screen-media.is-missing .lp-screen-image{display:none}
.lp-screen-media.is-missing .lp-screen-placeholder{display:grid}
.lp-screen-placeholder-label{font-size:12px;font-weight:700;letter-spacing:.08em;color:var(--accent);text-transform:uppercase}
.lp-screen-placeholder strong{font-size:18px;line-height:1.45;color:#111827}
.lp-screen-media-hero{aspect-ratio:16/10}
.lp-screen-media-main{aspect-ratio:16/8.4}
.lp-screen-media-analysis,.lp-screen-media-vertical{aspect-ratio:4/3}
.lp-screen-card-side .lp-screen-media{aspect-ratio:1.45/1}
.lp-screen-card-side .lp-screen-copy p{line-height:1.6}
.lp-screen-media-hero .lp-screen-image{object-position:66% 0}
.lp-screen-media-main .lp-screen-image{object-position:48% top}
.lp-screen-media-analysis .lp-screen-image{object-position:right 8%}
.lp-screen-media-vertical .lp-screen-image{object-position:center 10%}
.lp-cta{padding:28px 24px;display:grid;justify-items:center;gap:14px;text-align:center}
.lp-cta-title{font-size:clamp(30px,3.4vw,42px)}
body.landing-mode #guestModeBadge,body.landing-mode #guestFocusBtn,body.landing-mode #guestPomodoroBtn{display:none!important}
.login-brand-wrap{display:flex;justify-content:center}
.login-brand-icon{height:64px;width:auto;display:block;object-fit:contain}
#loginForm{display:grid;gap:12px}#loginForm label{display:grid;gap:6px;color:var(--muted);font-size:14px}
#registerForm{display:grid;gap:12px}#registerForm label{display:grid;gap:6px;color:var(--muted);font-size:14px}
#passwordResetForm{display:grid;gap:12px}#passwordResetForm label{display:grid;gap:6px;color:var(--muted);font-size:14px}
#loginForm .remember-login-row{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px}
#loginForm .remember-login-row input{width:auto;padding:0}
.auth-section-title{margin:0;font-size:18px;font-weight:700;color:var(--text)}
.auth-info-message{margin:0;color:var(--muted);font-size:14px;line-height:1.6}
.auth-security-note{margin:0;color:var(--muted);font-size:12px;line-height:1.55}
.link-btn{align-self:flex-start;border:0;background:transparent;color:var(--muted);padding:0;font-size:12px;font-weight:500;text-decoration:underline}
.link-btn:hover{background:transparent;color:var(--accent-hover)}
input,textarea,button,select{font:inherit}
input,textarea,select{width:100%;border:1px solid var(--line);background:#fff;border-radius:10px;padding:10px 12px;color:var(--text)}
input:focus,textarea:focus,select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}
button{border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--text);padding:9px 12px;font-weight:600;cursor:pointer;transition:.15s ease}
button:hover{background:#fff7ed}button:active{transform:translateY(1px)}
.icon-svg{display:block;object-fit:contain;pointer-events:none;flex-shrink:0}
.icon-svg-sm{width:14px;height:14px}
.icon-svg-md{width:18px;height:18px}
.icon-svg-pomodoro{width:40px;height:40px}
.hamburger-icon{width:20px;height:20px}
.x-login-button{
  background:#000;
  border:none;
  padding:6px;
  width:34px;
  height:34px;
  border-radius:6px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.x-login-button img{
  width:18px;
  height:18px;
  display:block;
  object-fit:contain;
  pointer-events:none;
}
.x-login-button:hover{background:#222}
.login-x-button{
  background:#000 !important;
  color:#fff;
  border:none;
  width:100%;
  height:auto;
  min-height:40px;
  padding:10px 0;
  margin:2px 0 0;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.login-x-button:hover{
  background:#222 !important;
}
.login-x-button img{
  width:20px;
  height:20px;
}
.icon-btn{width:34px;height:34px;padding:0;display:flex;align-items:center;justify-content:center;font-size:14px}
button.is-loading{position:relative;padding-left:30px}
button.is-loading::before{content:"";position:absolute;left:10px;top:50%;width:12px;height:12px;margin-top:-6px;border:2px solid rgba(15,23,42,.2);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}
#loginForm button,#newDocBtn,#newGroupBtn,#applyNovelFixBtn,#runLintBtn{background:var(--accent);border-color:var(--accent);color:#fff}#loginForm button:hover,#newDocBtn:hover,#newGroupBtn:hover,#applyNovelFixBtn:hover,#runLintBtn:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
#loginForm .link-btn{background:transparent;border:0;color:var(--muted);padding:0;font-size:12px;font-weight:500;justify-self:start}
#loginForm .link-btn:hover{background:transparent;border:0;color:var(--accent-hover)}
#registerForm button{background:var(--accent);border-color:var(--accent);color:#fff}
#passwordResetForm button{background:var(--accent);border-color:var(--accent);color:#fff}
#registerForm button:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
#passwordResetForm button:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
#loginForm button:disabled,#loginForm button[aria-busy="true"]{opacity:.85}
#registerForm button:disabled,#registerForm button[aria-busy="true"]{opacity:.85}
#passwordResetForm button:disabled,#passwordResetForm button[aria-busy="true"]{opacity:.85}
.ghost-btn{background:#fff;color:var(--text)}
#registerMessage.ok{color:#166534}
.error.ok{color:#166534}
#newGroupBtn{background:#df8b5d;border-color:#df8b5d}
#newGroupBtn:hover{background:#d47947;border-color:#d47947}
.app{display:grid;grid-template-columns:minmax(220px,280px) minmax(0,1fr) minmax(300px,380px);gap:16px;flex:1;min-height:0;height:100%}
.doc-list,.editor,.panel{padding:14px;min-width:0;min-height:0}
.doc-list,.panel{position:static;top:auto;align-self:stretch;height:100%;overflow:auto;overscroll-behavior:contain}
.left-panel{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
.document-panel-header{flex-shrink:0}
.document-panel-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:4px;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.doc-actions{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.doc-actions-sub{display:flex;align-items:center;gap:6px;margin:-2px 0 10px}
.doc-mini-action-btn{font-size:11px;line-height:1.2;padding:4px 8px;min-height:24px;border-radius:8px;background:#fff}
.touch-only-btn{display:none}
.touch-ui .touch-only-btn{display:inline-flex}
.doc-icon-btn{
  width:34px;
  min-width:34px;
  height:34px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
}
.doc-action-icon{
  width:18px;
  height:18px;
  filter:brightness(0) invert(1);
}
.doc-group-select-wrap{
  position:relative;
  flex:1;
  min-width:0;
}
.doc-search-trigger{
  position:absolute;
  left:0;
  top:0;
  width:34px;
  height:34px;
  padding:0;
  border:0;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1;
}
.doc-search-trigger:hover{background:transparent}
.doc-search-icon{
  width:16px;
  height:16px;
  opacity:.65;
}
#docsSearchInput{
  width:100%;
  height:34px;
  padding-left:30px;
  padding-right:8px;
  font-size:13px;
  line-height:1.2;
}
#docsSearchInput::placeholder{
  font-size:13px;
}
#docsSearchInput.search-no-hit{
  border-color:#dc2626;
  box-shadow:0 0 0 2px rgba(220,38,38,.15);
}
.doc-group-select-hidden{
  display:none!important;
}
#documentsList{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.touch-ui #documentsList .long-press-target,
.touch-ui #documentsList .long-press-target *{
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}
.touch-ui #documentsList .long-press-target{
  -webkit-tap-highlight-color:transparent;
}
.group-item{padding:0}
.group-head{display:flex;align-items:center;gap:6px;min-height:34px;border-radius:8px;padding:0 4px}
.group-head:hover{background:#fff7ed}
.group-head.is-focused{background:#ffedd5;box-shadow:inset 0 0 0 1px #fdba74}
.group-head.is-dragging,.doc-list-item.is-dragging{opacity:.55}
.group-head.drag-over-before,.doc-list-item.drag-over-before{box-shadow:inset 0 2px 0 var(--accent)}
.group-head.drag-over-after,.doc-list-item.drag-over-after{box-shadow:inset 0 -2px 0 var(--accent)}
.group-head.drag-over-group{background:#ffedd5}
.group-toggle{background:transparent;padding:2px 4px;border-color:transparent;min-height:auto}
.folder-row-icon{width:15px;height:15px;opacity:.9}
.group-title{font-size:13px;font-weight:600;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.group-title{cursor:pointer}
.group-mini-btn{padding:2px 6px;font-size:11px;line-height:1.2;border-radius:7px}
.group-doc-list{list-style:none;margin:0;padding:0 0 0 16px;display:grid;gap:1px}
.doc-list-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center;min-height:34px}
.doc-item-btn{width:100%;text-align:left;background:transparent;border-color:transparent;display:flex;align-items:center;gap:7px;padding:6px 8px;border-radius:8px}
.doc-item-btn:hover{background:#fff7ed}
.doc-item-btn.active{border-color:transparent;background:#ffedd5;color:var(--accent-hover)}
.doc-item-marker{color:#9ca3af;font-size:11px;line-height:1}
.document-row-icon{width:12px;height:12px;opacity:.72}
.doc-item-title{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.doc-item-updated{font-size:12px;color:var(--muted);line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.doc-menu-wrap{position:relative}
.doc-menu-btn{width:28px;height:28px;padding:0;display:flex;align-items:center;justify-content:center;border-radius:8px;background:transparent;color:var(--muted);opacity:0}
.doc-list-item:hover .doc-menu-btn,.group-head:hover .doc-menu-btn,.doc-menu-wrap:focus-within .doc-menu-btn{opacity:1}
.doc-menu-btn:hover{background:#fff7ed;color:var(--text)}
.doc-menu-popup{position:absolute;right:0;z-index:5;min-width:136px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 6px 14px rgba(15,23,42,.10);padding:4px}
.doc-menu-popup.open-down{top:34px;bottom:auto}
.doc-menu-popup.open-up{bottom:34px;top:auto}
.doc-menu-item{width:100%;text-align:left;border:0;background:transparent;padding:7px 10px;border-radius:8px;font-size:13px;line-height:1.25;white-space:nowrap;display:flex;align-items:center;gap:6px}
.doc-menu-item:hover{background:#fff7ed}
.doc-menu-item.danger{color:#b91c1c}
.editor{display:grid;grid-template-rows:auto 1fr auto;gap:10px;scroll-margin-top:12px}.editor-head{display:flex;gap:10px;align-items:center}
.header-title-row{display:flex;align-items:center;gap:8px}
.header-title-input{flex:1;min-width:0;height:34px;padding:6px 12px;font-size:13px;line-height:1.2}
.header-actions{display:flex;align-items:center;gap:8px;margin-bottom:0}
#docTitle{font-weight:600}#docGroupSelect{display:none!important}
.editor-body{--editor-line-height:28.8px;--editor-pad-top:12px;position:relative;display:grid;grid-template-columns:minmax(0,1fr);border:1px solid var(--line);border-radius:10px;background:#fff;overflow:hidden}
.editor.is-empty .editor-body{background:#f5f5f4}
.editor.is-empty #docTitle,.editor.is-empty #editorText{color:var(--muted)}
.line-gutter{display:none!important}
.line-number{height:var(--editor-line-height);display:flex;align-items:center;justify-content:flex-end;line-height:1}
.editor-overlay,#editorText{font-family:"Noto Sans JP","Inter",system-ui,sans-serif;font-size:16px;font-weight:400;font-style:normal;line-height:1.8;letter-spacing:normal;tab-size:4;text-align:left;white-space:pre-wrap;overflow-wrap:break-word;word-break:break-word;box-sizing:border-box}.editor-overlay,.line-gutter,.no-document-message{pointer-events:none}
.editor-overlay{display:none}
#editorText{grid-column:1;grid-row:1;position:relative;z-index:2;min-height:0;height:100%;resize:vertical;border:0;border-radius:0;background:transparent;padding:12px 14px;caret-color:#2563eb;caret-width:3px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y pinch-zoom}
#editorText::selection{background:rgba(255,220,120,.35)}
#editorText::-moz-selection{background:rgba(255,220,120,.35)}
.no-document-message{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--muted);font-weight:600;pointer-events:none;z-index:2}
/* Current-line underline overlay was removed to simplify UI and reduce editor update cost. */
.editor-status-bar{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;padding:6px 10px 7px;font-size:12px;line-height:1.35;color:var(--muted);border-top:1px solid var(--line);background:rgba(255,255,255,.55);border-radius:0 0 10px 10px}
.editor-status-bar strong{color:var(--text)}
#statusSave{margin-left:auto;font-weight:600;color:var(--accent-hover)}
.panel-stack{display:grid;gap:10px}
.right-panel{display:flex;flex-direction:column;height:100%;min-height:0}
.analysis-tabs{flex-shrink:0}
.analysis-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:4px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.tabs{display:flex;gap:8px;margin-bottom:10px}
.panel .tab-btn{background:transparent;font-size:14px;font-weight:700;line-height:1.2;padding:6px 10px}
#guestFocusBtn,#authFocusBtn,#guestPomodoroBtn,#headerPomodoroBtn{font-size:14px;font-weight:700;line-height:1.2;padding:6px 10px;min-height:30px;border-radius:10px}
#guestPomodoroBtn,#headerPomodoroBtn{white-space:nowrap}
#guestPomodoroBtn.is-active,#headerPomodoroBtn.is-active{background:#ffedd5;border-color:var(--accent);color:var(--accent-hover)}
.header-actions button{font-size:13px;line-height:1.2;padding:0 10px;height:34px;min-height:34px;border-radius:10px;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}
.tab-btn.active{background:#ffedd5;border-color:var(--accent);color:var(--accent-hover)}
.tab-content{display:none}
.tab-content.active{display:block}
.analysis-card{border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.6);padding:10px}
.panel .analysis-card{padding:14px}
.panel .analysis-card h3{margin:0 0 8px;font-size:14px;font-weight:700;line-height:1.3;color:var(--text)}
.panel .analysis-card .analysis-card-label{margin:0 0 6px;font-size:11px;font-weight:600;line-height:1.3;color:var(--muted)}
.counts-card{overflow:visible}
.panel .stats{list-style:none;margin:0;padding:0;display:grid;gap:6px;color:var(--text);font-size:12px;font-weight:500;line-height:1.4}
.panel .stats li{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#countWithNewline,#countWithoutNewline,#lineCount,#pageCount,#selectionCount,#dialogueRate{font-size:12px;font-weight:600;color:var(--text)}
.analysis-card-note{margin:10px 0 0;font-size:11px;line-height:1.5;color:var(--muted)}
.genko-note{margin-top:7px;font-size:11px;line-height:1.55;color:#8b8b8b;font-weight:400;letter-spacing:0;max-width:30em}
.feedback-modal-card{width:min(560px,100%)}
.feedback-modal-body{display:grid;gap:10px}
.feedback-field{display:grid;gap:6px}
.feedback-field>span{font-size:13px;font-weight:700;color:var(--text)}
.feedback-body-input{min-height:180px;resize:vertical}
.feedback-note{margin:2px 0 0}
#feedbackEnvironmentInput::placeholder{font-size:12px}
.insight-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.panel .insight-list li{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:12px;font-weight:500;color:var(--text);background:#fff7ed;border:1px solid var(--line);border-radius:10px;padding:4px 8px}
.panel .insight-list li.insight-clickable{cursor:pointer}
.panel .insight-list li.insight-clickable:hover{background:#ffedd5}
.panel .insight-list li.insight-clickable:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}
.insight-list .count{color:var(--accent-hover);font-weight:600}
.dialogue-rate-row{position:relative}
.panel .help-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;margin:0 2px 0 0;border-radius:999px;font-size:12px;font-weight:700;line-height:1;color:var(--accent-hover);background:#ffedd5;border:1px solid var(--line);vertical-align:middle}
.help-icon-btn:hover{background:#fed7aa;border-color:#fdba74}
.dialogue-help-popover{position:absolute;right:0;top:calc(100% + 6px);z-index:12;width:min(300px,calc(100vw - 40px));padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 10px 24px rgba(15,23,42,.12);font-size:12px;line-height:1.45;color:var(--text)}
.dialogue-help-title{margin:0 0 6px;font-weight:700}
.dialogue-help-popover ul{margin:0 0 6px 16px;padding:0}
.dialogue-help-note{margin:0;color:var(--muted)}
:root{
  --mobile-fab-size:42px;
}
.touch-fab-wrap{position:relative;display:flex;flex-direction:column;align-items:center}
.touch-fab-main{
  width:var(--mobile-fab-size);
  height:var(--mobile-fab-size);
  border-radius:999px;
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
  font-size:22px;
  line-height:1;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
.touch-fab-main:hover,
.touch-fab-main:focus,
.touch-fab-main:active,
.touch-fab-main.is-active{
  background:var(--accent-hover);
  border-color:var(--accent-hover);
  color:#fff;
}
.touch-fab-menu{
  position:absolute;
  right:calc(100% + 8px);
  bottom:0;
  display:grid;
  gap:6px;
  min-width:150px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:0 8px 24px rgba(15,23,42,.16);
  padding:8px;
}
.touch-fab-menu button{font-size:12px;line-height:1.3;padding:8px 10px;min-height:36px}
.touch-ui .touch-fab-wrap,
.touch-ui .touch-fab-wrap *,
.touch-ui .touch-sheet-actions,
.touch-ui .touch-sheet-actions *{
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}
.touch-sheet-card{max-width:360px}
.touch-sheet-actions{display:grid;gap:8px;padding:2px 0}
.touch-sheet-actions button{width:100%;text-align:left;min-height:42px;padding:10px 12px}
body.touch-reorder-mode #documentsList .doc-item-btn,
body.touch-reorder-mode #documentsList .group-head{position:relative}
body.touch-reorder-mode #documentsList .doc-item-btn::before,
body.touch-reorder-mode #documentsList .group-head::before{content:"≡";color:var(--muted);font-size:14px;margin-right:6px}
.issues{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:8px;max-height:58vh;overflow:auto;-webkit-overflow-scrolling:touch}
.issue-item{border:1px solid var(--line);border-radius:10px;padding:10px;background:#fff;cursor:pointer}.issue-item:hover{background:#fff7ed}.issue-item.error{border-color:#fdba74;background:#ffedd5}
.dict-actions{display:flex;gap:8px;margin-bottom:10px}#addDictEntryBtn{background:#fff}
#tab-history .history-actions button{font-size:14px;font-weight:700;line-height:1.2;padding:6px 10px;min-height:30px;border-radius:10px}
#tab-history .history-note{color:var(--muted);font-size:11px;font-weight:500;line-height:1.4;padding:2px 0}
#tab-history .history-preview{color:var(--muted);font-size:11px;line-height:1.4}
#tab-history #historyInfoNote{white-space:pre-line}
#tab-history .history-info-card{background:transparent;border-color:transparent;padding:0;box-shadow:none}
#tab-history .history-item-head{display:flex;align-items:center;gap:8px}
#tab-history .history-restore-btn{font-size:12px;line-height:1.1;padding:4px 10px;min-height:26px;border-radius:8px}
.guest-mode #guestEditorActions button{white-space:nowrap;font-size:13px;line-height:1.2}
.novel-fix-actions{margin-bottom:12px}
.panel #applyNovelFixBtn{
  font-size:12px;
  font-weight:600;
  padding:6px 12px;
  min-height:28px;
  border-radius:10px;
}
.novel-fix-rules{display:grid;gap:8px;margin-bottom:10px}
.novel-fix-rule{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text)}
.novel-fix-rule-main{display:flex;align-items:center;gap:8px;flex:1;min-width:0}
.novel-fix-rule input{width:auto}
.ruby-settings-toggle-btn{width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;font-size:14px;line-height:1;background:#fff}
.ruby-settings-toggle-btn.is-open{background:#ffedd5;border-color:var(--accent);color:var(--accent-hover)}
.ruby-convert-card{margin-top:8px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:8px}
.ruby-convert-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.ruby-convert-actions-left{display:flex;justify-content:flex-start}
.ruby-convert-actions-right{display:flex;justify-content:flex-end;gap:6px}
.ruby-convert-actions button{font-size:12px;line-height:1.2;padding:5px 9px;min-height:28px;border-radius:8px}
.ruby-table-wrap{overflow:auto;-webkit-overflow-scrolling:touch}
.ruby-table{width:100%;border-collapse:separate;border-spacing:0}
.ruby-table th,.ruby-table td{font-size:12px;padding:6px;border-bottom:1px solid #fde3c8;vertical-align:middle}
.ruby-table th{text-align:left;color:var(--muted);font-weight:600;background:#fffaf4;position:sticky;top:0}
.ruby-table td input{width:100%;padding:6px 8px;font-size:12px;border-radius:8px}
.ruby-table td input::placeholder{color:#c4b5a5}
.ruby-input-wrap{display:grid;gap:3px}
.ruby-table td input.is-invalid{border-color:#ef4444;box-shadow:0 0 0 1px rgba(239,68,68,.15)}
.ruby-field-error{margin:0;font-size:11px;line-height:1.25;color:#dc2626}
.ruby-delete-btn{font-size:14px;line-height:1;padding:0;width:28px;height:28px;min-height:28px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center}
.ruby-empty-note{font-size:11px;color:var(--muted);text-align:center}
.panel .muted-note{margin:8px 0 0;color:var(--muted);font-size:11px;font-weight:500;line-height:1.4;min-height:16px}
.panel .novel-fix-rule{font-size:12px;line-height:1.4}
.pomodoro-panel{border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.6);padding:10px;display:grid;gap:8px}
.pomodoro-title-row{display:flex;align-items:center;gap:6px;position:relative}
.pomodoro-title{margin:0;font-size:14px;line-height:1.3;font-weight:700;color:var(--text)}
.pomodoro-title-row .dialogue-help-popover{right:0;top:calc(100% + 6px);width:min(320px,calc(100vw - 44px))}
.pomodoro-main-row{display:flex;justify-content:flex-start;align-items:center;gap:8px}
.pomodoro-left{flex:1;min-width:0;display:grid;gap:4px}
.pomodoro-time{margin:0;font-size:40px;line-height:1.02;font-weight:700;color:var(--text)}
.pomodoro-phase{margin:0;font-size:12px;line-height:1.35;font-weight:700;color:var(--accent-hover)}
.pomodoro-phase.is-break{color:#4b6a95}
.pomodoro-count{margin:0;font-size:12px;line-height:1.35;font-weight:500;color:var(--muted)}
.pomodoro-right{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;flex:0 0 auto}
.pomodoro-icon-buttons{display:flex;gap:8px;align-items:center;justify-content:center}
.pomodoro-icon-btn{width:40px;height:40px;padding:0;border-radius:50%;font-size:17px;line-height:1;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid #f4bb84;color:#d08744}
.pomodoro-icon-btn:hover{background:#fff7ed;border-color:#e8a867;color:#b96820}
.pomodoro-icon-btn:disabled{opacity:.45;cursor:not-allowed}
.pomodoro-stop-btn{position:relative}
.pomodoro-reset-count-btn{font-size:12px;line-height:1.2;font-weight:600;padding:4px 10px;min-height:28px;border-radius:10px;white-space:nowrap;align-self:center}
.pomodoro-status-message{margin:0;font-size:11px;line-height:1.4;color:var(--muted);min-height:16px}
.frequent-mode-switch{display:flex;gap:6px;margin-bottom:8px}
.frequent-mode-btn{background:transparent;font-size:12px;font-weight:700;line-height:1.2;padding:4px 10px;min-height:28px;border-radius:10px}
.frequent-mode-btn.is-active{background:#ffedd5;border-color:var(--accent);color:var(--accent-hover)}
.frequent-words-list{margin-top:8px}
.cross-search-card{display:grid;gap:8px}
.cross-search-input-wrap{position:relative;min-width:0}
.cross-search-input-wrap input{width:100%;height:34px;min-width:0;padding-left:30px;padding-right:8px;font-size:13px;line-height:1.2}
.cross-search-input-wrap input::placeholder{font-size:13px}
.cross-search-inline-icon-btn{position:absolute;left:0;top:0;width:34px;height:34px;padding:0;border:0;background:transparent;display:flex;align-items:center;justify-content:center;z-index:1}
.cross-search-inline-icon-btn:hover{background:transparent}
.cross-search-inline-icon-btn.is-disabled,
.cross-search-inline-icon-btn:disabled{opacity:.45;cursor:not-allowed}
.cross-search-inline-icon{width:16px;height:16px;display:block;object-fit:contain;opacity:.65;pointer-events:none}
.cross-search-scope{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.cross-search-scope-btn{background:transparent;font-size:12px;font-weight:700;line-height:1.2;padding:4px 10px;min-height:28px;border-radius:10px}
.cross-search-scope-btn.is-active{background:#ffedd5;border-color:var(--accent);color:var(--accent-hover)}
.cross-search-scope-btn.is-disabled,
.cross-search-scope-btn:disabled{opacity:.45;cursor:not-allowed;background:#fff;border-color:var(--line);color:var(--muted)}
.cross-search-results{list-style:none;margin:0;padding:0;display:grid;gap:6px;max-height:50vh;overflow:auto;-webkit-overflow-scrolling:touch}
.cross-search-item{border:1px solid var(--line);border-radius:10px;background:#fff7ed;padding:7px 8px;cursor:pointer}
.cross-search-item:hover{background:#ffedd5}
.cross-search-item:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}
.cross-search-doc-title{font-size:12px;font-weight:700;line-height:1.3;color:var(--text);margin-bottom:2px}
.cross-search-snippet{font-size:12px;font-weight:500;line-height:1.45;color:var(--muted);word-break:break-word}
.cross-search-snippet mark{background:#fde68a;color:inherit;padding:0 1px;border-radius:2px}
.frequent-diagnosis{margin-top:8px}
.frequent-diagnosis-type{margin:0 0 6px;font-size:12px;font-weight:700;line-height:1.3;color:var(--text)}
.frequent-diagnosis .stats{margin-top:8px}
.frequent-diagnosis .muted-note{margin-top:6px}
.dict-row{display:grid;grid-template-columns:1fr 1fr 110px;gap:8px;margin-bottom:8px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}
.error{color:#b91c1c;margin:8px 0 0}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes slowBlink{0%{opacity:1}50%{opacity:.3}100%{opacity:1}}
.loading-overlay{position:fixed;inset:0;background:rgba(255,247,237,.68);display:flex;align-items:center;justify-content:center;z-index:9999}
.loading-panel{display:flex;flex-direction:column;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px 18px;box-shadow:0 10px 24px rgba(194,65,12,.12)}
.loading-spinner{width:26px;height:26px;border:3px solid rgba(194,65,12,.25);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}
#loadingMessage{margin:0;color:var(--text);font-size:14px}
.modal-overlay{position:fixed;inset:0;background:rgba(31,41,55,.25);display:flex;align-items:center;justify-content:center;padding:20px;z-index:10000;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.modal-card{width:min(520px,100%);max-height:calc(100dvh - 40px);background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 14px 30px rgba(0,0,0,.12);padding:14px;overflow:auto;-webkit-overflow-scrolling:touch}
.preview-modal{z-index:10000}
#confirmModal{z-index:11000}
#imageExportSettingsModal{z-index:11020}
#selectionImageExportSettingsModal{z-index:11030}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.modal-head h2{margin:0;font-size:16px}
.modal-body{display:grid;gap:10px}
.inline-check{display:flex;align-items:center;gap:8px;color:var(--text)}
.inline-check input{width:auto}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.confirm-modal-message{white-space:pre-line}
.image-export-type-card{width:min(420px,100%)}
.image-export-type-body{display:grid;gap:8px}
.image-export-option-row{display:flex;align-items:center;gap:8px}
.image-export-main-button{flex:1;min-height:40px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:8px}
.image-export-main-button > span{display:inline-flex;align-items:flex-end}
.image-export-setting-button{width:40px;min-width:40px;height:40px;padding:0;display:inline-flex;align-items:center;justify-content:center}
.image-export-setting-icon{width:18px;height:18px}
.image-output-count-inline{
  align-self:flex-end;
  font-size:12px;
  line-height:1;
  color:var(--muted);
  font-weight:500;
}
.image-export-selection-warning{margin:0 4px 2px;font-size:12px;line-height:1.4;color:var(--muted)}
.image-export-settings-card{width:min(420px,100%)}
.image-export-settings-body{display:grid;gap:10px}
.image-export-settings-field{display:grid;gap:6px;color:var(--muted);font-size:13px}
.image-export-settings-field input,.image-export-settings-field select{height:36px;padding:6px 10px}
.selection-export-settings-card{width:min(520px,100%)}
.selection-export-preview-wrap{display:grid;gap:6px}
.selection-export-preview{
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  padding:10px;
  height:280px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.sns-card{
  box-sizing:border-box;
  border-radius:16px;
  padding:48px;
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  gap:22px;
  font-family:"Noto Sans JP","Inter",system-ui,sans-serif;
  line-height:1.8;
}
.sns-card.sns-card-direction-horizontal,
.sns-card.direction-horizontal{
  width:960px;
  height:540px;
}
.sns-card.sns-card-direction-vertical,
.sns-card.direction-vertical{
  width:540px;
  height:960px;
}
.sns-card.sns-card-layout-card{
  border:1px solid var(--line);
  box-shadow:0 8px 20px rgba(15,23,42,.08);
}
.sns-card.sns-card-layout-simple{
  border:0;
  box-shadow:none;
  border-radius:0;
  padding:40px;
}
.sns-card.sns-card-theme-light{
  background:#fff;
  color:#1f2937;
}
.sns-card.sns-card-theme-dark{
  background:#111827;
  color:#f8fafc;
}
.sns-card.sns-card-theme-paper{
  background:
    linear-gradient(0deg, rgba(255,255,255,.22), rgba(255,255,255,.22)),
    repeating-linear-gradient(
      0deg,
      rgba(120,90,40,.025) 0px,
      rgba(120,90,40,.025) 2px,
      rgba(247,243,232,1) 2px,
      rgba(247,243,232,1) 6px
    );
  color:#222;
}
.sns-card.sns-card-theme-night-sky{
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.28) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 28%, rgba(255,255,255,.22) 0 1px, transparent 1.5px),
    radial-gradient(circle at 42% 70%, rgba(255,255,255,.16) 0 1px, transparent 1.5px),
    linear-gradient(180deg, #111f3f 0%, #0f172a 100%);
  color:#f8fafc;
}
.sns-card.sns-card-theme-forest{
  background:linear-gradient(180deg, #274a36 0%, #1f3d2b 100%);
  color:#f5f5f4;
}
.sns-card.sns-card-theme-sakura{
  background:linear-gradient(180deg, #fff6fa 0%, #fff1f5 100%);
  color:#3f3f46;
}
.sns-card.sns-card-theme-navy{
  background:linear-gradient(180deg, #0f4fb5 0%, #0b3d91 100%);
  color:#fff;
}
.sns-card-text{
  margin:0;
  min-height:0;
  max-height:100%;
  overflow:hidden;
  white-space:pre-wrap;
  word-break:break-word;
  overflow-wrap:break-word;
  font-size:28px;
}
.sns-card-text ruby{
  ruby-position:over;
}
.sns-card-text rt{
  font-size:.58em;
  line-height:1;
}
.sns-card.sns-card-direction-horizontal .sns-card-text{
  writing-mode:horizontal-tb;
}
.sns-card.sns-card-direction-vertical .sns-card-text{
  writing-mode:vertical-rl;
  text-orientation:mixed;
}
.sns-card.sns-card-direction-vertical .sns-card-footer,
.sns-card.direction-vertical .sns-card-footer{
  text-align:left;
}
.sns-card-footer{
  margin-top:auto;
  font-size:14px;
  opacity:.6;
  text-align:right;
}
.sns-card-preview-frame{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.sns-card-preview-scale{
  position:relative;
  overflow:hidden;
  flex:0 0 auto;
}
#saveSettingsBtn{background:var(--accent);border-color:var(--accent);color:#fff}
#saveSettingsBtn:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
#settingsDeleteAccountBtn{
  margin-right:auto;
  background:#9ca3af;
  border-color:#9ca3af;
  color:#fff;
}
#settingsDeleteAccountBtn:hover{
  background:#6b7280;
  border-color:#6b7280;
}
.settings-message{min-height:18px;margin:0;font-size:12px;color:var(--muted)}
.settings-message.error{color:#b91c1c}
.delete-account-warning{margin:0;color:#7c2d12;font-size:13px;line-height:1.6}
.delete-account-check{margin-top:8px}
.danger-btn{background:#dc2626;border-color:#dc2626;color:#fff}
.danger-btn:hover{background:#b91c1c;border-color:#b91c1c}
.danger-btn:disabled{opacity:.6;cursor:not-allowed}
.vertical-preview-card{position:relative;width:min(960px,100%);max-height:min(88vh,900px);display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:10px}
.vertical-preview-card .modal-head{display:grid;grid-template-columns:1fr auto auto;align-items:center;column-gap:8px;padding-right:44px}
.vertical-preview-doc-title{margin:0;color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vertical-preview-mode-switch{display:flex;align-items:center;justify-self:end;gap:6px;color:var(--muted);font-size:12px;line-height:1.3}
.vertical-preview-mode-label{margin-right:2px}
.vertical-preview-mode-btn{font-size:12px;font-weight:600;line-height:1.2;padding:4px 8px;min-height:26px;border-radius:8px}
.vertical-preview-mode-btn.is-active{background:#ffedd5;border-color:var(--accent);color:var(--accent-hover)}
.vertical-preview-card #closeVerticalPreviewBtn{position:absolute;top:20px;right:20px;left:auto;z-index:2}
.vertical-preview-body{border:1px solid var(--line);border-radius:10px;background:#fff;padding:14px;min-height:320px;overflow-x:auto;overflow-y:hidden}
.vertical-preview-scale-wrap{width:100%;height:100%;transform:none;transform-origin:center center}
.vertical-preview-frame{position:relative;width:100%;height:100%;border:0;border-radius:0;background:transparent;box-shadow:none}
.vertical-preview-frame::before,.vertical-preview-frame::after{content:none}
.vertical-preview-screen{width:100%;height:100%;overflow:hidden;background:transparent;padding:0}
.vertical-preview-scroll-area{width:100%;height:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
.vertical-preview-content{margin:0;min-height:100%;font-family:"Yu Mincho","Hiragino Mincho ProN","Hiragino Mincho Pro","MS PMincho","MS Mincho",serif;font-size:16px;line-height:1.9;letter-spacing:.02em;white-space:pre-wrap;word-break:break-word;writing-mode:vertical-rl;text-orientation:mixed;color:var(--text)}
.vertical-preview-content{display:block;height:100%;min-width:100%;width:max-content}
.vertical-preview-content ruby{ruby-position:inter-character}
.vertical-preview-content rt{font-size:.56em;line-height:1;color:var(--muted)}
.vertical-preview-card.mobile-preview-mode{width:min(980px,100%)}
.vertical-preview-body.mobile-preview{
  --mobile-preview-scale:1;
  padding:10px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.vertical-preview-body.mobile-preview .vertical-preview-scale-wrap{
  width:430px;
  height:860px;
  flex:0 0 auto;
  transform:scale(var(--mobile-preview-scale));
}
.vertical-preview-body.mobile-preview .vertical-preview-frame{
  width:430px;
  height:860px;
  position:relative;
  border:10px solid #0f172a;
  border-radius:44px;
  background:#f8fafc;
  box-shadow:0 14px 34px rgba(15,23,42,.18);
}
.vertical-preview-body.mobile-preview .vertical-preview-frame::before{
  content:"";
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:96px;
  height:18px;
  border-radius:0 0 12px 12px;
  background:#0f172a;
  z-index:2;
  pointer-events:none;
}
.vertical-preview-body.mobile-preview .vertical-preview-frame::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  width:142px;
  height:8px;
  border-radius:999px;
  background:#cbd5e1;
  z-index:2;
  pointer-events:none;
}
.vertical-preview-body.mobile-preview .vertical-preview-screen{
  width:100%;
  height:100%;
  overflow:hidden;
  background:#fffdfa;
  border-radius:34px;
  padding:28px 18px 20px;
}
.vertical-preview-body.mobile-preview .vertical-preview-scroll-area{
  width:100%;
  height:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.vertical-preview-body.mobile-preview .vertical-preview-scroll-area::-webkit-scrollbar{
  height:6px;
}
.vertical-preview-body.mobile-preview .vertical-preview-scroll-area::-webkit-scrollbar-thumb{
  background:#cbd5e1;
  border-radius:999px;
}
.vertical-preview-body.mobile-preview .vertical-preview-content{
  display:block;
  height:100%;
  min-width:100%;
  width:max-content;
  font-size:15px;
  line-height:1.95;
  letter-spacing:.02em;
}
.x-export-render-root{position:fixed;left:-20000px;top:0;width:0;height:0;overflow:hidden;opacity:0;pointer-events:none;z-index:-1}
.x-export-page{width:960px;height:1480px;box-sizing:border-box;background:#fff;color:#1f2937;position:relative;overflow:hidden}
.x-export-page-header{position:absolute;left:44px;right:44px;top:26px;color:#94a3b8;font-size:16px;line-height:1.2;letter-spacing:.01em;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.x-export-page-body{position:absolute;inset:52px 44px 92px 44px;min-width:0;min-height:0;overflow:hidden;writing-mode:vertical-rl;text-orientation:mixed;font-family:"Yu Mincho","Hiragino Mincho ProN","Hiragino Mincho Pro","MS PMincho","MS Mincho",serif;font-size:31px;line-height:1.7;letter-spacing:.005em;white-space:pre-wrap;word-break:break-word}
.x-export-page-body ruby{ruby-position:inter-character}
.x-export-page-body rt{font-size:.56em;line-height:1;color:#6b7280}
.x-export-page-footer{position:absolute;left:44px;right:44px;bottom:26px;display:flex;align-items:center;justify-content:space-between;color:#94a3b8;font-size:16px;line-height:1.2}
.x-export-watermark{font-size:16px;letter-spacing:.01em;opacity:.8}
.x-export-page-number{font-size:16px;opacity:.9}
.word-export-page{width:1240px;height:1754px;box-sizing:border-box;background:#fff;color:#111827;position:relative;overflow:hidden}
.word-export-page-header{position:absolute;left:100px;right:100px;top:36px;font-size:18px;line-height:1.2;color:#94a3b8;letter-spacing:.01em;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.word-export-page-body{position:absolute;inset:96px 100px 120px 100px;overflow:hidden;writing-mode:horizontal-tb;font-family:"Yu Mincho","Hiragino Mincho ProN","Hiragino Mincho Pro","MS PMincho","MS Mincho",serif;font-size:30px;line-height:1.9;letter-spacing:.01em;white-space:pre-wrap;word-break:break-word}
.word-export-page-body ruby{ruby-position:over}
.word-export-page-body rt{font-size:.56em;line-height:1;color:#6b7280}
.word-export-page-footer{position:absolute;left:100px;right:100px;bottom:36px;display:flex;justify-content:space-between;align-items:center;font-size:18px;color:#94a3b8}
.word-export-watermark{opacity:.8}
.word-export-page-number{opacity:.9}
.preview-icon-btn{width:34px;min-width:34px;padding:0;display:inline-flex;align-items:center;justify-content:center}
.preview-eye-icon{width:18px;height:18px;display:block;pointer-events:none}
.copy-icon{width:18px;height:18px;display:block;pointer-events:none}
.app-toast{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%) scale(.98);
  max-width:min(calc(100vw - 28px),420px);
  padding:14px 22px;
  border-radius:10px;
  border:0;
  background:rgba(17,24,39,.9);
  color:#fff;
  font-size:14px;
  font-weight:500;
  line-height:1.35;
  text-align:center;
  box-shadow:0 6px 18px rgba(0,0,0,.25);
  opacity:0;
  pointer-events:none;
  z-index:2200;
  transition:opacity .16s ease,transform .16s ease;
}
.app-toast.is-visible{opacity:1;transform:translate(-50%,-50%) scale(1)}
.app-toast.is-success{background:rgba(17,24,39,.9);color:#fff}
.app-toast.is-error{background:rgba(127,29,29,.92);color:#fff}
.scroll-jump-buttons{position:fixed;right:20px;bottom:20px;z-index:40;display:flex;flex-direction:column;gap:8px;align-items:center}
.scroll-top-btn,.scroll-bottom-btn{width:var(--mobile-fab-size);height:var(--mobile-fab-size);padding:0;display:flex;align-items:center;justify-content:center;border-radius:999px;background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 8px 18px rgba(15,23,42,.18)}
.scroll-top-btn:hover,.scroll-bottom-btn:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.guest-mode .doc-list{display:none}
.guest-mode .app{grid-template-columns:minmax(0,1fr) minmax(280px,360px)}
.guest-mode .editor{grid-column:1}
.guest-mode .panel{grid-column:2}
.guest-mode #docGroupSelect{display:none}
.guest-mode [data-auth-only]{display:none!important}
body.focus-mode .doc-list,body.focus-mode .panel{display:none!important}
body.focus-mode main{max-width:980px}
body.focus-mode .app{grid-template-columns:minmax(0,1fr);gap:10px}
body.focus-mode .editor{max-width:920px;width:100%;margin:0 auto}
body.focus-mode .editor-status-bar{max-width:920px;width:100%;margin:0 auto}
body.is-tablet-landscape .editor{width:100%;max-width:none;min-width:0}
body.is-tablet-landscape .editor-body,
body.is-tablet-landscape .editor-body #editorText,
body.is-tablet-landscape .editor-body .editor-overlay{width:100%;max-width:100%}
body.is-tablet-landscape.guest-mode .app{grid-template-columns:minmax(0,1fr) minmax(280px,360px)}
body.is-tablet-landscape.guest-mode .editor{grid-column:1;margin:0;max-width:none}
body.is-tablet-landscape.guest-mode .panel{grid-column:2}
body.is-tablet-landscape.focus-mode main{max-width:100%}
body.is-tablet-landscape.focus-mode .app{grid-template-columns:minmax(0,1fr)!important;gap:12px}
body.is-tablet-landscape.focus-mode .editor,
body.is-tablet-landscape.focus-mode .editor-status-bar{width:min(100%,1180px);max-width:none;margin:0 auto}
button#guestFocusBtn.is-active{background:#ffedd5;border-color:var(--accent);color:var(--accent-hover)}
@media (pointer: coarse){
  #editorText{resize:none}
}
@media (pointer: coarse){
  .doc-list-item,.group-head,.doc-item-btn,.doc-menu-btn,.doc-icon-btn,.doc-search-trigger{min-height:44px}
  .doc-item-btn{padding:8px 10px}
  .doc-menu-btn{opacity:1}
  .doc-actions{gap:10px}
  .doc-mini-action-btn{min-height:28px}
}
@media (max-width:1080px){
  .lp-root{padding:20px 0 44px}
  .lp-shell{gap:40px}
  .lp-hero-inner{grid-template-columns:1fr;gap:20px}
  .lp-hero-copy{max-width:none}
  .lp-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lp-screen-showcase{gap:16px}
  .lp-screen-media-main{aspect-ratio:16/9}
  .lp-screen-row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .app{grid-template-columns:1fr}
  .doc-list{order:2}
  .panel{order:3}
  .doc-list,.panel{position:static;top:auto;max-height:none;overflow:visible}
  body.is-touch-ui:not(.tablet-layout) .app{
    height:auto;
    min-height:0;
  }
  body.is-touch-ui:not(.tablet-layout) .left-panel,
  body.is-touch-ui:not(.tablet-layout) .right-panel{
    display:block;
    height:auto;
    min-height:auto;
    overflow:visible;
  }
  body.is-touch-ui:not(.tablet-layout) .document-panel-header,
  body.is-touch-ui:not(.tablet-layout) .analysis-tabs{
    position:static;
  }
  body.is-touch-ui:not(.tablet-layout) .document-panel-body,
  body.is-touch-ui:not(.tablet-layout) .analysis-body{
    flex:none;
    min-height:auto;
    max-height:none;
    overflow:visible;
    padding-right:0;
    -webkit-overflow-scrolling:auto;
    overscroll-behavior:auto;
  }
  body.is-touch-ui:not(.tablet-layout) .issues,
  body.is-touch-ui:not(.tablet-layout) .cross-search-results,
  body.is-touch-ui:not(.tablet-layout) .ruby-table-wrap{
    max-height:none;
    overflow:visible;
    -webkit-overflow-scrolling:auto;
  }
  body.is-touch-ui:not(.tablet-layout) .doc-list.left-panel{
    height:auto;
    max-height:none;
    overflow:visible;
    -webkit-overflow-scrolling:auto;
    overscroll-behavior:auto;
    touch-action:auto;
  }
  body.is-touch-ui:not(.tablet-layout) .doc-list.left-panel .doc-item-btn,
  body.is-touch-ui:not(.tablet-layout) .doc-list.left-panel .group-head{
    touch-action:auto;
  }
  .left-panel{overflow:hidden}
  .document-panel-body{overflow-y:auto}
  .guest-mode .app{grid-template-columns:1fr}
  .guest-mode .editor,.guest-mode .panel{grid-column:auto}
  .guest-mode .panel{order:3}
  #editorText{min-height:360px}
  .editor-body{grid-template-columns:minmax(0,1fr)}
  .scroll-jump-buttons{right:14px;bottom:14px}
  main{height:auto;min-height:calc(100svh - var(--header-height));min-height:calc(100dvh - var(--header-height))}
  :root{--gutter-width:clamp(40px,5ch,52px)}
}
@media (max-width:768px){
  .lp-root{padding:16px 0 36px}
  .lp-shell{gap:32px}
  .lp-title{font-size:42px}
  .lp-description,.lp-cta-copy{font-size:15px}
  .lp-actions{flex-direction:column}
  .lp-primary-btn,.lp-secondary-btn{width:100%}
  .lp-feature-grid,.lp-screen-row{grid-template-columns:1fr}
  .lp-feature-card,.lp-screen-card,.lp-cta{border-radius:16px}
  .lp-screen-card,.lp-feature-card{padding:16px}
  .lp-screen-media-hero,.lp-screen-media-main{aspect-ratio:16/10.5}
  .lp-screen-media-analysis,.lp-screen-media-vertical{aspect-ratio:16/10}
  html,body{max-width:100%;overflow-x:hidden}
  body.is-touch-ui main{height:auto;min-height:calc(100svh - var(--header-height));min-height:calc(100dvh - var(--header-height))}
  .app,.doc-list,.editor,.panel,.topbar,.topbar-right,.header-actions,.doc-actions,.doc-group-select-wrap,#docsSearchInput{max-width:100%}
  .doc-toolbar-buttons,
  .sort-mode-actions,
  .doc-actions-sub{
    display:flex;
    align-items:center;
    gap:8px;
  }
  .doc-toolbar-buttons button,
  .sort-mode-actions button,
  .doc-actions-sub .doc-mini-action-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    padding-top:0;
    padding-bottom:0;
  }
  #verticalPreviewModal{padding:10px;align-items:flex-start}
  .vertical-preview-card{max-height:min(calc(100dvh - 20px),900px);gap:8px}
  .vertical-preview-body{min-height:0;padding:10px}
  .topbar-right{min-width:0}
  #loginUser{max-width:min(42vw,220px)}
  .editor{order:1}
  .panel{order:2}
  .doc-list{order:3}
  main{padding:10px 12px}
  .topbar{padding:0 12px}
  #guestFocusBtn,#authFocusBtn{display:none!important}
  .app{gap:10px}
  .editor,.panel,.doc-list{padding:10px}
  .editor-head{flex-wrap:wrap;gap:8px}
  .guest-mode .editor-head{align-items:flex-start}
  .guest-mode #docTitle{flex:1 1 100%}
  .guest-mode #guestEditorActions{width:100%;display:flex;gap:8px}
  .guest-mode #guestEditorActions button{flex:1 1 auto;font-size:12px}
  .analysis-card{padding:9px}
  .panel .tab-btn{font-size:14px}
  .panel .analysis-card{padding:12px}
  .panel .analysis-card h3{font-size:14px}
  .panel .stats{font-size:12px}
  #countWithNewline,#countWithoutNewline,#lineCount,#pageCount,#selectionCount,#dialogueRate{font-size:12px}
  .panel .insight-list li{font-size:12px}
  .panel .muted-note{font-size:11px}
  .pomodoro-title{font-size:14px}
  .pomodoro-main-row{flex-wrap:wrap}
  .pomodoro-time{font-size:34px}
  .pomodoro-right{width:100%;align-items:flex-start}
  #statusSave{margin-left:0}
  .editor-status-bar{padding:6px 8px}
  .line-gutter{padding:var(--editor-pad-top) 6px var(--editor-pad-bottom) 4px;font-size:11px}
  .dialogue-help-popover{left:0;right:auto;width:min(280px,calc(100vw - 32px))}
  .vertical-preview-card .modal-head{grid-template-columns:1fr auto;row-gap:6px;padding-right:40px}
  .vertical-preview-mode-switch{grid-column:1 / -1;justify-self:end}
  .vertical-preview-card #closeVerticalPreviewBtn{top:16px;right:16px}
  :root{--gutter-width:clamp(34px,4.5ch,44px)}
}
@media (min-width:769px) and (max-width:1180px){
  body.tablet-layout .app{grid-template-columns:minmax(220px,280px) minmax(0,1fr) minmax(280px,360px)}
  body.tablet-layout .doc-list,body.tablet-layout .panel{overflow:auto}
  body.tablet-layout .doc-list-item,body.tablet-layout .group-head{min-height:48px}
  body.is-tablet-landscape.focus-mode .app{grid-template-columns:minmax(0,1fr)!important}
  body.is-tablet-landscape.guest-mode .app{grid-template-columns:minmax(0,1fr) minmax(280px,360px)}
}
@media (max-width:480px){
  .app-title-logo{height:1.5em}
  .topbar h1{font-size:16px}
  .guest-mode-badge{font-size:11px;padding:2px 6px}
  #editorText{min-height:300px}
  :root{--mobile-fab-size:36px}
  .touch-fab-main{font-size:20px}
  .scroll-jump-buttons{right:10px;bottom:10px;gap:6px}
}

/* Hide bottom-right floating action buttons without changing HTML/JS. */
.floating-actions,
.scroll-buttons,
#newDocFloatingBtn,
#scrollJumpButtons,
#touchFabWrap,
#touchFabMainBtn,
#scrollTopBtn,
#scrollBottomBtn{
  display:none !important;
}
