@import './src/ui/motion-tokens.css';
@import './src/ui/motion.css';

:root {
  color-scheme: light;
  --task-checked: var(--accent); --task-border: color-mix(in srgb, var(--muted) 25%, var(--bg)); --on-accent: #fff; --bg: #fff; --sidebar: #f7f8fb; --canvas: #fafbfe; --card: #fff;
  --text: #292b3d; --muted: #8c8f9e; --secondary: #676b7e; --border: #ebedf3;
  --accent: #7864d9; --accent-hover: #6954cb; --tint: #eeebfb; --line: #ddd7f5;
  --green: #40917b; --green-bg: #eaf6f0; --orange: #bf9146; --orange-bg: #fbf4e7;
  --red: #c5666a; --shadow: 0 3px 12px #30314c05, 0 1px 2px #30314c04;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif, "Segoe UI";
  font-family: var(--font);
  font-synthesis: style; font-size: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --task-border: #626b80; --on-accent: #201d30; --bg: #181a22; --sidebar: #14161e; --canvas: #1b1d27; --card: #222530;
  --text: #e6e7f0; --muted: #9196ab; --secondary: #b1b5c8; --border: #2e3241;
  --accent: #b2a0ff; --accent-hover: #c4b7ff; --tint: #302a46; --line: #494061;
  --green: #7ac5a7; --green-bg: #243b34; --orange: #d9b376; --orange-bg: #3a3226;
  --red: #ef9298; --shadow: 0 4px 16px #00000014;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; background: transparent; color: inherit; }
:focus { outline: none; }
button:focus-visible, a:focus-visible { background: var(--tint); color: var(--accent); }
button:disabled { cursor: default; opacity: .38; }
input, textarea, select { color: var(--text); }
input, textarea { min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); }
select { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
::selection { background: var(--tint); }
.workspace { margin-left: 254px; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.workspace > ink-topbar, .workspace > ink-notifications { flex-shrink: 0; }
@media (min-width: 701px) {
  .workspace[data-sidebar-motion] { transition: margin-left var(--motion-navigation) var(--motion-ease-move); }
  .workspace #content { width: 100%; max-width: 800px; margin-inline: auto; }
  .workspace:not(.sidebar-collapsed) { margin-left: var(--sidebar-width, 254px); }
  .workspace.sidebar-collapsed { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .workspace[data-sidebar-motion] { transition: none; } }
.workspace > ink-view-controls { padding: 0; }
.main { flex: 1; min-height: 0; width: 100%; overflow: auto; position: relative; padding: 20px 44px 28px; }
.document-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.document-layout.editing { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 25px; }
#source-editor { display: block; border: 0; border-radius: 0; padding: 8px 0 60px; field-sizing: content; width: 100%; min-height: calc(100dvh - 120px); background: transparent; resize: none; overflow: auto; outline: 0; font: 13px/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace; tab-size: 2; white-space: pre-wrap; overflow-wrap: normal; }
.markdown { color: var(--secondary); font-size: 12px; line-height: 1.95; min-width: 0; padding: 0 1px; }
.markdown > p:first-child { color: var(--muted); margin-top: 0; margin-bottom: 24px; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { color: var(--text); line-height: 1.5; font-weight: 600; margin: 26px 0 13px; }
.markdown h1 { font-size: 25px; }
.markdown h2 { font-size: 17px; }
.markdown h3 { font-size: 14px; }
.markdown p { margin: 12px 0; overflow-wrap: anywhere; }
.markdown strong { font-weight: 600; color: var(--text); }
.markdown ul, .markdown ol { padding-left: 22px; }
.markdown li { margin: 5px 0; }
.markdown blockquote { border-left: 3px solid var(--line); background: var(--sidebar); padding: 12px 17px; margin: 20px 0; border-radius: 0 7px 7px 0; font-size: 11px; }
.markdown code { font: .92em ui-monospace, "SFMono-Regular", Consolas, monospace; background: var(--tint); color: var(--accent); border-radius: 4px; padding: 2px 5px; }
.markdown pre { position: relative; background: var(--sidebar); border: 1px solid var(--border); border-radius: 9px; padding: 34px 18px 18px; overflow-x: auto; line-height: 1.7; }
.markdown pre code { padding: 0; background: transparent; color: var(--secondary); font-size: 11px; }
.code-language { position: absolute; top: 9px; left: 17px; font-size: 8px; color: var(--muted); }
.markdown hr { height: 1px; border: 0; background: var(--border); margin: 25px 0; }
.table-wrap { overflow-x: auto; }
.markdown table { border-collapse: collapse; width: 100%; font-size: 11px; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; }
.markdown th { background: var(--sidebar); font-weight: 500; }
.task-block { border: 1px solid var(--border); border-radius: 10px; margin: 12px 0 20px; overflow: hidden; }
.task-block-head { display: flex; align-items: center; gap: 8px; font-size: 10px; padding: 9px 14px; background: var(--canvas); border-bottom: 1px solid var(--border); color: var(--secondary); }
.task-block-head svg { width: 13px; }
.task-block-head > span:first-child { color: var(--accent); }
.task-block-head button { margin-left: auto; font-size: 9px; color: var(--accent); padding: 3px; }
@media (min-width: 1550px) { .main { padding-top: 20px; } }
@media (max-width: 1170px) { .main { padding: 18px 36px 24px; }
.workspace { margin-left: 230px; }
.workspace > ink-view-controls { padding: 0; } }
@media (max-width: 900px) { .workspace { margin-left: 205px; }
.workspace > ink-view-controls { padding: 0; }
.main { padding: 16px 28px 24px; }
.document-layout.editing { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) { .workspace { margin: 0; }
.workspace > ink-view-controls { padding: 0; }
.main { padding: 14px 20px 20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print { #source-editor { display: none !important; }
.workspace { margin: 0; }
.main { padding: 0; max-width: none; overflow: visible; }
.workspace { height: auto; overflow: visible; }
.document-layout.editing { display: block; } }

.boot-state, .route-state { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; background: var(--canvas); color: var(--secondary); }
.route-state h1 { font-size: 24px; color: var(--text); }
.route-state button { padding: 10px 20px; border: 1px solid var(--border); border-radius: 7px; color: var(--accent); background: var(--card); cursor: pointer; }
.route-empty { padding: 40px 0; color: var(--secondary); }

/* Fast navigation replaces the placeholder before it becomes visible. */
.boot-state { visibility: hidden; animation: reveal-boot-state 0s 300ms forwards; }
@keyframes reveal-boot-state { to { visibility: visible; } }
