/* Whrick web. Design tokens follow docs/DESIGN.md; motion, materials and touch follow the
   apple-design skill (springs and sheets live in app.js). */

/* Interface font: Apple SD Gothic Neo where the reader's device has it (Mac, iPhone, iPad; it is
   never sent from here, its licence covers Apple devices only), otherwise Pretendard (SIL OFL 1.1,
   the author's own woff2 files, unmodified), which has the same feel.
   Bundled fonts (SIL OFL 1.1, unmodified, see /font-licenses.txt).
   Documents pick a set per document (.page.font-*): 고딕 Source Sans 3 + Gothic A1,
   명조 Source Serif 4 + Nanum Myeongjo, 바탕 Source Serif 4 + Gowun Batang, and the single
   faces 프리텐다드 (new documents), 고운돋움, IBM Plex Sans KR, 함렛 (variable), 도현 and 가석.
   The Korean faces carry a unicode-range, so they download only for text with Hangul. */
@font-face { font-family: "Pretendard"; src: url("/Pretendard-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("/Pretendard-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("/Pretendard-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("/Pretendard-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/SourceSans3-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/SourceSans3-Semibold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/SourceSans3-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/SourceSans3-It.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/SourceSerif4-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/SourceSerif4-Semibold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/SourceSerif4-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/SourceSerif4-It.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/SourceSerif4-BoldIt.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Gothic A1"; src: url("/GothicA1-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+1100-11FF, U+3000-303F, U+3130-318F, U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF, U+FF01-FF60, U+FFE0-FFE6; }
@font-face { font-family: "Gothic A1"; src: url("/GothicA1-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+1100-11FF, U+3000-303F, U+3130-318F, U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF, U+FF01-FF60, U+FFE0-FFE6; }
@font-face { font-family: "Nanum Myeongjo"; src: url("/NanumMyeongjo-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+1100-11FF, U+3000-303F, U+3130-318F, U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF, U+FF01-FF60, U+FFE0-FFE6; }
@font-face { font-family: "Nanum Myeongjo"; src: url("/NanumMyeongjo-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+1100-11FF, U+3000-303F, U+3130-318F, U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF, U+FF01-FF60, U+FFE0-FFE6; }
@font-face { font-family: "Gowun Batang"; src: url("/GowunBatang-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+1100-11FF, U+3000-303F, U+3130-318F, U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF, U+FF01-FF60, U+FFE0-FFE6; }
@font-face { font-family: "Gowun Batang"; src: url("/GowunBatang-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+1100-11FF, U+3000-303F, U+3130-318F, U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF, U+FF01-FF60, U+FFE0-FFE6; }

/* ------------------------------------------------------------------ tokens
   Colors, radii and spacing follow docs/DESIGN.md. Motion and materials follow the
   apple-design skill: feedback on press, springs for anything a finger can move
   (app.js), translucent chrome with content scrolling underneath, size-specific
   tracking, and gentler equivalents for reduced motion / transparency / more contrast. */
/* More document fonts (SIL OFL 1.1): Korean faces that carry their own Latin letters. */
@font-face { font-family: "Gowun Dodum"; src: url("/GowunDodum-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Do Hyeon"; src: url("/DoHyeon-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gasoek One"; src: url("/GasoekOne-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Hahmlet"; src: url("/Hahmlet-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/IBMPlexSansKR-Thin.ttf") format("truetype"); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/IBMPlexSansKR-ExtraLight.ttf") format("truetype"); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/IBMPlexSansKR-Light.ttf") format("truetype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/IBMPlexSansKR-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/IBMPlexSansKR-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/IBMPlexSansKR-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/IBMPlexSansKR-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;

  --primary: #0066cc;
  --primary-focus: #0071e3;
  --primary-on-dark: #2997ff;
  --danger: #c4201a;

  /* surfaces */
  --bg: #ffffff;              /* canvas */
  --bg-alt: #f5f5f7;          /* parchment */
  --surface: #ffffff;         /* cards, menus, sheets */
  --surface-2: #fafafc;       /* pearl chips */
  --page: #ffffff;            /* the document paper */
  --tint: #e8f1fb;            /* selected chip */
  --hover: rgba(0, 0, 0, 0.045);
  --pressed: rgba(0, 0, 0, 0.08);

  /* text */
  --text: #1d1d1f;
  --text-2: #333333;
  --text-3: #6e6e73;
  --on-accent: #ffffff;
  --accent-text: var(--primary);

  /* lines */
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.18);

  /* chrome and materials */
  --chrome: rgba(0, 0, 0, 0.9);                  /* global nav: dark, heavy material */
  --chrome-solid: #000000;
  --material: rgba(250, 250, 252, 0.72);         /* sub-nav, bars, sheets: light material */
  --material-strong: rgba(255, 255, 255, 0.92);
  --material-edge: rgba(255, 255, 255, 0.6);     /* bright top edge, light catching the glass */
  --blur: saturate(180%) blur(20px);
  --scrim: rgba(0, 0, 0, 0.32);

  /* depth: bigger surfaces read thicker */
  --shadow-chip: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.16);
  --product-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;

  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 9999px;

  /* spacing in rem so it grows with the reader's text size */
  --sp-xxs: 0.25rem;
  --sp-xs: 0.5rem;
  --sp-sm: 0.75rem;
  --sp-md: 1.0625rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-xxl: 3rem;
  --sp-section: 5rem;
  --gutter: 22px;

  --nav-h: 44px;
  --subnav-h: 52px;
  --tap: 44px;               /* minimum touch target */

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);

  /* every interface text: Apple SD Gothic Neo (installed) first, then the bundled Pretendard */
  --font-ui: "Apple SD Gothic Neo", "AppleSDGothicNeo", "Pretendard", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-display: var(--font-ui);
  --font-text: var(--font-ui);
  --font-doc: "Source Sans 3", "Gothic A1", sans-serif;
  --font-doc-heading: "Source Sans 3", "Gothic A1", sans-serif;

  /* press: instant, small, and only on transform */
  --press-scale: 0.97;
  --press-time: 100ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #1c1c1e;
    --surface: #2a2a2c;
    --surface-2: #2c2c2e;
    --page: #1d1d1f;
    --tint: rgba(41, 151, 255, 0.18);
    --hover: rgba(255, 255, 255, 0.06);
    --pressed: rgba(255, 255, 255, 0.1);
    --text: #f5f5f7;
    --text-2: #d1d1d6;
    --text-3: #98989d;
    --accent-text: var(--primary-on-dark);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --chrome: rgba(22, 22, 23, 0.8);
    --material: rgba(29, 29, 31, 0.72);
    --material-strong: rgba(44, 44, 46, 0.9);
    --material-edge: rgba(255, 255, 255, 0.08);
    --scrim: rgba(0, 0, 0, 0.5);
    --shadow-float: 0 10px 32px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.5);
    --danger: #ff6961;
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-size: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;          /* 17px body */
  line-height: 1.47;
  letter-spacing: -0.01em;       /* body: near zero */
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  -webkit-tap-highlight-color: transparent;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
button, input, select, textarea { font-family: inherit; }
button, a, select, input, label, [role="button"] { touch-action: manipulation; } /* no double-tap delay */
.hidden { display: none !important; }
.touch-only { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pressed feedback lives on pointer-down and is instant (section 1 of the skill). */
.pressable { transition: transform var(--press-time) ease-out, background-color 120ms ease-out, opacity 120ms ease-out; }
.pressable:active { transform: scale(var(--press-scale)); }

/* ------------------------------------------------------------------ global nav (dark material) */
.global-nav {
  position: sticky; top: 0; z-index: 30;
  background: var(--chrome);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: #fff;
  padding-top: var(--safe-t);
}
.global-nav__inner { max-width: 1440px; margin: 0 auto; height: var(--nav-h); padding: 0 var(--gutter); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; min-height: var(--tap); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; display: block; }
.global-nav__links { display: flex; align-items: center; gap: 22px; flex: 1; }
.global-nav__links a, .global-nav__links button { color: rgba(255, 255, 255, 0.86); font-size: 12px; letter-spacing: 0; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-text); min-height: var(--tap); display: inline-flex; align-items: center; }
.global-nav__links a:hover, .global-nav__links button:hover { color: #fff; text-decoration: none; }
.global-nav__links .is-current { color: var(--primary-on-dark); }
.global-nav__links .spacer { flex: 1; }
.global-nav__links .who { color: rgba(255, 255, 255, 0.6); font-size: 12px; }
.nav-toggle { display: none; margin-left: auto; width: var(--tap); height: var(--tap); border: 0; background: none; color: #fff; cursor: pointer; border-radius: var(--r-pill); align-items: center; justify-content: center; }
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle:active { background: rgba(255, 255, 255, 0.12); }

/* ------------------------------------------------------------------ sub nav (light material) */
.sub-nav {
  position: sticky; top: calc(var(--nav-h) + var(--safe-t)); z-index: 20;
  background: var(--material);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
/* Scroll edge effect instead of a hard divider: appears only when content is under it. */
.sub-nav::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; pointer-events: none; opacity: 0; transition: opacity 200ms ease; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0)); }
.sub-nav.is-scrolled::after { opacity: 1; }
.sub-nav__inner { max-width: 1440px; margin: 0 auto; min-height: var(--subnav-h); padding: 0 var(--gutter); display: flex; align-items: center; gap: var(--sp-sm); }
.sub-nav__title { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.012em; line-height: 1.19; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-nav__end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-xs); flex-shrink: 0; }

/* ------------------------------------------------------------------ buttons */
.btn { font-family: var(--font-text); font-size: 1.0625rem; letter-spacing: -0.01em; line-height: 1; border-radius: var(--r-pill); padding: 11px 22px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; min-height: 40px; transition: transform var(--press-time) ease-out, background-color 120ms ease-out, opacity 120ms ease-out; user-select: none; -webkit-user-select: none; }
.btn:active { transform: scale(var(--press-scale)); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-accent); }
.btn-primary:hover { text-decoration: none; background: var(--primary-focus); }
.btn-secondary { background: transparent; color: var(--accent-text); border-color: currentColor; }
.btn-secondary:hover { text-decoration: none; background: var(--hover); }
.btn-hero { font-size: 1.125rem; font-weight: 400; padding: 14px 28px; min-height: 48px; }
.btn-sm { font-size: 0.875rem; padding: 8px 16px; min-height: 34px; }
.btn-utility { background: var(--text); color: var(--bg); border-radius: var(--r-sm); font-size: 0.875rem; padding: 8px 15px; min-height: 34px; }
.btn-pearl, .chip { white-space: nowrap; flex: none; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 0.875rem; padding: 7px 14px; min-height: 34px; box-shadow: var(--shadow-chip); }
.btn-pearl:hover, .chip:hover { background: var(--surface-2); text-decoration: none; }
.btn-pearl.is-on, .chip.is-on { background: var(--tint); color: var(--accent-text); border-color: currentColor; box-shadow: none; }
.btn-icon { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: var(--r-pill); }
.btn-icon svg { width: 18px; height: 18px; }
.btn-danger { background: transparent; color: var(--danger); border-color: currentColor; }
.link-btn { background: none; border: 0; color: var(--accent-text); font: inherit; cursor: pointer; padding: 0; min-height: 32px; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ tiles */
.tile { padding: var(--sp-section) var(--gutter); text-align: center; }
.tile--light { background: var(--bg); }
.tile--parchment { background: var(--bg-alt); }
.tile--dark { background: #272729; color: #fff; }
.tile--dark a { color: var(--primary-on-dark); }
.tile__inner { max-width: 980px; margin: 0 auto; }
.hero-logo { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--product-shadow); margin-bottom: var(--sp-lg); }
/* Tracking is size-specific: tighter as type grows, leading tighter too. */
.hero-display { font-size: clamp(2.25rem, 1.2rem + 4.2vw, 3.5rem); line-height: 1.07; letter-spacing: -0.022em; }
.display-lg { font-size: clamp(1.875rem, 1.3rem + 2.2vw, 2.5rem); line-height: 1.1; letter-spacing: -0.018em; }
.display-md { font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.125rem); line-height: 1.18; letter-spacing: -0.016em; }
.lead { font-size: clamp(1.3125rem, 1rem + 1.2vw, 1.75rem); line-height: 1.18; letter-spacing: -0.004em; font-weight: 400; margin: var(--sp-xs) 0 var(--sp-xl); }
.tagline { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 600; line-height: 1.19; letter-spacing: -0.012em; }
.muted { color: var(--text-3); }
.tile--dark .muted { color: #cccccc; }
.cta-row { display: flex; gap: var(--sp-sm); justify-content: center; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-xl); margin-top: var(--sp-xxl); text-align: left; }
.features > div { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--r-lg); padding: var(--sp-lg); }
.features h3 { font-size: 1.3125rem; letter-spacing: -0.012em; margin-bottom: var(--sp-xs); }
.features p { margin: 0; color: #cccccc; font-size: 1rem; }

/* ------------------------------------------------------------------ cards & forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-lg); text-align: left; }
.auth-card { max-width: 26.25rem; margin: 0 auto; }
.auth-card h2 { font-size: 1.75rem; letter-spacing: -0.016em; margin-bottom: var(--sp-xs); }
.field { display: block; margin-top: var(--sp-md); }
.field__label { display: block; font-size: 0.875rem; font-weight: 600; letter-spacing: -0.006em; margin-bottom: 6px; }
.field__hint { display: block; font-size: 0.75rem; letter-spacing: 0.005em; color: var(--text-3); margin-top: 6px; }
.input { width: 100%; font: inherit; font-size: max(1rem, 16px); /* 16px+ stops iOS zooming on focus */ color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 11px 14px; min-height: var(--tap); transition: border-color 120ms ease, box-shadow 120ms ease; }
.input:focus { outline: none; border-color: var(--primary-focus); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.22); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input--pill { border-radius: var(--r-pill); padding: 10px 18px; }
.form-error { color: var(--danger); font-size: 0.875rem; margin: var(--sp-sm) 0 0; min-height: 1.4em; }
.form-actions { margin-top: var(--sp-lg); display: flex; gap: var(--sp-sm); align-items: center; flex-wrap: wrap; }
.switch-line { margin-top: var(--sp-md); font-size: 0.875rem; color: var(--text-3); }

/* 구글로 계속하기: 화면 너비의 알약 단추, 진주색 바탕과 hairline(DESIGN.md button-pearl) */
.auth-google { margin-top: var(--sp-lg); }
.btn-google { width: 100%; min-height: var(--tap); gap: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--hairline, #e0e0e0); font-size: 1.0625rem; font-weight: 600; }
.btn-google:hover { background: var(--hover); }
.btn-google:active { transform: scale(0.95); }
.btn-google:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 2px; }
.btn-google.is-busy { opacity: 0.6; cursor: progress; }
.btn-google__mark { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0; }
.auth-google__note { margin: var(--sp-xs) 0 0; font-size: 0.8125rem; color: var(--text-3); text-align: center; }
.auth-or { display: flex; align-items: center; gap: var(--sp-sm); margin-top: var(--sp-lg); font-size: 0.8125rem; color: var(--text-3); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* 구글 로그인 실패 쪽(서버가 상태 코드와 함께 보내는 작은 HTML) */
.oauth-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); padding: var(--sp-lg) var(--gutter); }
.oauth-card { max-width: 28rem; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-xl) var(--sp-lg); text-align: center; }
.oauth-card h1 { font-size: 1.5rem; letter-spacing: -0.012em; margin: 0 0 var(--sp-sm); }
.oauth-card p { color: var(--text-2); margin: 0 0 var(--sp-sm); }
.oauth-card .oauth-code { font-size: 0.8125rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.oauth-card .btn { margin-top: var(--sp-sm); }

/* ------------------------------------------------------------------ documents grid */
.docs { background: var(--bg-alt); min-height: calc(100dvh - var(--nav-h) - var(--subnav-h)); padding: var(--sp-xxl) var(--gutter) var(--sp-section); }
.docs__inner { max-width: 1440px; margin: 0 auto; }
.docs__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-md); margin-bottom: var(--sp-xl); flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 22px; }
.doc-card { display: flex; flex-direction: column; gap: var(--sp-sm); padding: var(--sp-md); transition: transform var(--press-time) ease-out; }
.doc-card:has(.doc-card__thumb:active) { transform: scale(0.985); }
.doc-card__thumb { display: block; background: var(--bg-alt); border-radius: var(--r-md); padding: 18px; }
.doc-card__thumb img { display: block; width: 100%; height: auto; aspect-ratio: 210 / 297; object-fit: cover; background: #fff; border-radius: 3px; box-shadow: var(--product-shadow); }
.doc-card__name { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.012em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card__meta { font-size: 0.875rem; color: var(--text-3); }
.doc-card__actions { display: flex; gap: var(--sp-md); font-size: 0.875rem; align-items: center; }
.doc-card__actions a, .doc-card__actions button { min-height: 32px; display: inline-flex; align-items: center; }
.empty { text-align: center; padding: var(--sp-section) var(--sp-lg); }

/* ------------------------------------------------------------------ editor */
.toolbar { display: flex; align-items: center; gap: var(--sp-xs); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; padding: 6px 2px; overscroll-behavior-x: contain; }
.toolbar::-webkit-scrollbar { display: none; }
.title-input { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.012em; border: 0; background: transparent; color: var(--text); width: 16ch; min-width: 9ch; padding: 6px 8px; border-radius: var(--r-sm); flex-shrink: 1; }
.title-input:hover { background: var(--hover); }
.title-input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--primary-focus); }
.select { font: inherit; font-size: 0.875rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 30px 7px 14px; min-height: 34px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237a7a7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; box-shadow: var(--shadow-chip); cursor: pointer; }
.save-state { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; min-width: 4.5em; text-align: right; }
.save-state.is-error { color: var(--danger); }
.canvas { background: var(--bg-alt); padding: var(--sp-xxl) var(--gutter) calc(var(--sp-section) + var(--safe-b)); min-height: calc(100dvh - var(--nav-h) - var(--subnav-h)); }
.page { --pt: calc(1.0625rem / 11); background: var(--page); width: 100%; max-width: 816px; min-height: 1056px; margin: 0 auto; padding: 96px; border-radius: var(--r-lg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 12px 40px rgba(0, 0, 0, 0.05); outline: none; font-family: var(--font-doc); font-size: 1.0625rem; line-height: 1.6; letter-spacing: 0; color: var(--text); counter-reset: num; overflow-wrap: anywhere; caret-color: var(--primary); }
.page.font-serif { --font-doc: "Source Serif 4", "Nanum Myeongjo", serif; --font-doc-heading: "Source Serif 4", "Nanum Myeongjo", serif; }
.page.font-batang { --font-doc: "Source Serif 4", "Gowun Batang", serif; --font-doc-heading: "Source Serif 4", "Gowun Batang", serif; }
/* One face for both scripts. Faces with a single weight keep headings at that weight: a
   browser-made bold smears them. */
.page.font-pretendard { --font-doc: "Pretendard", "Gothic A1", sans-serif; --font-doc-heading: var(--font-doc); }
.page.font-dodum { --font-doc: "Gowun Dodum", "Gothic A1", sans-serif; --font-doc-heading: var(--font-doc); --doc-heading-weight: 400; }
.page.font-plex { --font-doc: "IBM Plex Sans KR", "Gothic A1", sans-serif; --font-doc-heading: var(--font-doc); }
.page.font-hahmlet { --font-doc: "Hahmlet", "Nanum Myeongjo", serif; --font-doc-heading: var(--font-doc); }
.page.font-dohyeon { --font-doc: "Do Hyeon", "Gothic A1", sans-serif; --font-doc-heading: var(--font-doc); --doc-heading-weight: 400; }
.page.font-gasoek { --font-doc: "Gasoek One", "Gothic A1", sans-serif; --font-doc-heading: var(--font-doc); --doc-heading-weight: 400; }
/* Font names shown in their own face (font menus and chips). */
.ff-pretendard { font-family: "Pretendard", sans-serif; }
.ff-sans { font-family: "Source Sans 3", "Gothic A1", sans-serif; }
.ff-serif { font-family: "Source Serif 4", "Nanum Myeongjo", serif; }
.ff-batang { font-family: "Source Serif 4", "Gowun Batang", serif; }
.ff-dodum { font-family: "Gowun Dodum", sans-serif; }
.ff-plex { font-family: "IBM Plex Sans KR", sans-serif; }
.ff-hahmlet { font-family: "Hahmlet", serif; }
.ff-dohyeon { font-family: "Do Hyeon", sans-serif; }
.ff-gasoek { font-family: "Gasoek One", sans-serif; }
.page.paper-letter { max-width: 816px; min-height: 1056px; }
.page.paper-a4 { max-width: 794px; min-height: 1123px; }
.blk { min-height: 1.6em; margin: 0 0 0.35em; white-space: pre-wrap; }
.blk[data-style="title"] { font-family: var(--font-doc-heading); font-weight: var(--doc-heading-weight, 600); font-size: 2.5rem; line-height: 1.1; letter-spacing: -0.018em; margin-bottom: 0.4em; }
.blk[data-style="heading1"] { font-family: var(--font-doc-heading); font-weight: var(--doc-heading-weight, 600); font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.014em; margin-top: 0.8em; }
.blk[data-style="heading2"] { font-family: var(--font-doc-heading); font-weight: var(--doc-heading-weight, 600); font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.01em; margin-top: 0.7em; }
.blk[data-style="heading3"] { font-family: var(--font-doc-heading); font-weight: var(--doc-heading-weight, 600); font-size: 1.125rem; letter-spacing: -0.006em; margin-top: 0.6em; }
.blk[data-style="bullet"], .blk[data-style="numbered"] { position: relative; padding-left: 1.6em; }
.blk[data-style="bullet"]::before { content: "\2022"; position: absolute; left: 0.4em; color: var(--text-2); }
.blk[data-style="numbered"] { counter-increment: num; }
.blk:not([data-style="numbered"]) { counter-reset: num; }
.blk[data-style="numbered"]::before { content: counter(num) "."; position: absolute; left: 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.blk[data-style="quote"] { border-left: 3px solid var(--line-strong); padding-left: 1em; color: var(--text-2); font-family: var(--font-doc-heading); font-style: italic; }
.page:empty::before { content: "여기에 쓰세요. 줄 앞에 #, -, 1. 을 붙이면 스타일이 바뀝니다."; color: var(--text-3); }
.banner { max-width: 816px; margin: 0 auto var(--sp-md); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-sm) var(--sp-md); display: flex; align-items: center; gap: var(--sp-sm); font-size: 0.875rem; flex-wrap: wrap; }

/* Bottom format bar (touch screens): a floating capsule of light material that rides
   above the on-screen keyboard (app.js moves it with visualViewport). */
.format-bar { display: none; }

/* ------------------------------------------------------------------ popovers (desktop menus)
   Anchored to their trigger: they grow out of it and shrink back into it (app.js springs
   --p from 0 to 1; transform-origin is set to the trigger). */
.menu { position: relative; }
.popover { position: fixed; z-index: 60; min-width: 13.75rem; max-width: 20rem; background: var(--material-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; box-shadow: var(--shadow-float); font-family: var(--font-text); font-size: 0.875rem; }
.popover a, .popover button, .menu-item { display: flex; align-items: center; width: 100%; text-align: left; padding: 8px 12px; min-height: 36px; border-radius: var(--r-sm); font-size: 0.875rem; letter-spacing: -0.006em; color: var(--text); background: none; border: 0; cursor: pointer; font-family: var(--font-text); }
.popover a:hover, .popover button:hover, .menu-item:hover { background: var(--hover); text-decoration: none; }
.popover a:active, .popover button:active, .menu-item:active { background: var(--pressed); }
.popover .danger, .menu-item.danger { color: var(--danger); }
.popover hr, .sheet hr { border: 0; height: 1px; background: var(--line); margin: 4px 2px; }

/* ------------------------------------------------------------------ sheets (touch screens)
   Bottom sheets follow the finger 1:1, rubber-band past the top, and on release are thrown
   to where the flick was going (app.js). The scrim dims with the sheet's progress. */
.sheet-scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); opacity: 0; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-height: min(85dvh, 40rem); display: flex; flex-direction: column; background: var(--material-strong); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-top: 1px solid var(--material-edge); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-sheet); padding: 0 var(--sp-md) calc(var(--sp-md) + var(--safe-b)); transform: translateY(110%); will-change: transform; touch-action: none; }
.sheet__grab { flex: none; height: 28px; display: flex; align-items: center; justify-content: center; cursor: grab; }
.sheet__grab::before { content: ""; width: 38px; height: 5px; border-radius: var(--r-pill); background: var(--line-strong); }
.sheet__title { flex: none; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.012em; padding: 0 var(--sp-xs) var(--sp-xs); }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.sheet .menu-item { min-height: var(--tap); font-size: 1.0625rem; padding: 10px 14px; border-radius: var(--r-md); }
.sheet__group { background: var(--surface); border-radius: var(--r-md); padding: 4px; margin-bottom: var(--sp-sm); }
.sheet__label { font-size: 0.8125rem; color: var(--text-3); padding: var(--sp-xs) var(--sp-sm) 4px; letter-spacing: 0; }
.sheet .chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px var(--sp-sm); }
.sheet .chip { min-height: 40px; font-size: 0.9375rem; padding: 8px 16px; }

/* ------------------------------------------------------------------ account */
.account { background: var(--bg-alt); padding: var(--sp-xxl) var(--gutter) var(--sp-section); min-height: calc(100dvh - var(--nav-h) - var(--subnav-h)); }
.account__inner { max-width: 40rem; margin: 0 auto; display: grid; gap: var(--sp-lg); }

/* ------------------------------------------------------------------ toast (materializes from the bottom, leaves the same way) */
.toast { position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%); background: rgba(39, 39, 41, 0.92); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; padding: 12px 20px; border-radius: var(--r-pill); font-size: 0.875rem; z-index: 80; max-width: calc(100vw - 32px); box-shadow: var(--shadow-float); pointer-events: none; }

/* ------------------------------------------------------------------ footer */
.footer { background: var(--bg-alt); color: var(--text-2); padding: 40px var(--gutter) calc(64px + var(--safe-b)); }
.footer__inner { max-width: 980px; margin: 0 auto; }
.footer__brand { font-size: 0.875rem; font-weight: 600; margin: 0 0 8px; }
.fine { font-size: 0.75rem; line-height: 1.5; letter-spacing: 0.004em; color: var(--text-3); margin: 4px 0; }
.noscript { text-align: center; padding: 40px; }
body.is-editor .footer { display: none; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1068px) { .page { padding: 64px; } }
@media (max-width: 833px) {
  .features { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  /* The open menu sits over content: a heavier, near-solid material keeps it legible. */
  .global-nav__links { position: absolute; top: calc(100%); left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 4px var(--gutter) 18px; background: rgba(0, 0, 0, 0.94); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transform-origin: top center; }
  .global-nav__links.is-open { display: flex; }
  .global-nav__links a, .global-nav__links button, .global-nav__links .who { font-size: 1.0625rem; min-height: 48px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .global-nav__links .spacer { display: none; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --subnav-h: 56px; }
  .tile { padding: var(--sp-xxl) var(--gutter); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .doc-card { padding: 10px; gap: 8px; }
  .doc-card__thumb { padding: 10px; }
  .doc-card__name { font-size: 0.9375rem; }
  .doc-card__meta { font-size: 0.75rem; }
  .doc-card__actions { gap: 12px; font-size: 0.8125rem; }
  .docs, .account { padding: var(--sp-lg) var(--gutter) calc(var(--sp-xxl) + var(--safe-b)); }
  .docs__head { margin-bottom: var(--sp-lg); }
  .auth-card { border-radius: var(--r-lg); }
  .sub-nav .btn-pearl.desktop-only, .desktop-only { display: none !important; }
  .touch-only { display: inline-flex !important; }
  .title-input { width: auto; flex: 1; min-width: 0; font-size: 1.125rem; }
  .save-state { min-width: 0; }
  /* The editor: the page fills the width; formatting moves to the bottom bar. */
  .canvas { padding: 0 0 calc(96px + var(--safe-b)); background: var(--page); }
  .page { padding: 20px 18px 40px; min-height: 60dvh; border-radius: 0; box-shadow: none; max-width: none; }
  .format-bar { display: flex; position: fixed; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); bottom: calc(10px + var(--safe-b)); z-index: 40; transform: translateY(var(--kb, 0px)); justify-content: flex-start; width: max-content; max-width: calc(100vw - 20px - var(--safe-l) - var(--safe-r)); margin: 0 auto; align-items: center; gap: 4px; padding: 5px; background: var(--material-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); border-top-color: var(--material-edge); border-radius: var(--r-pill); box-shadow: var(--shadow-float); overflow-x: auto; scrollbar-width: none; }
  .format-bar::-webkit-scrollbar { display: none; }
  .format-bar .chip { box-shadow: none; border-color: transparent; background: transparent; min-height: 38px; font-size: 0.875rem; padding: 6px 11px; flex: none; }
  .format-bar .chip.is-on { background: var(--tint); border-color: transparent; }
  .format-bar .btn-icon { flex: none; background: var(--surface); border: 1px solid var(--line); }
}
@media (max-width: 419px) { .grid { gap: 10px; } }

/* Touch screens get roomier targets even when wide (tablets). */
@media (pointer: coarse) {
  .btn-sm, .btn-pearl, .chip, .select { min-height: 40px; }
  .popover a, .popover button { min-height: var(--tap); }
}

/* ------------------------------------------------------------------ accessibility preferences */
/* Reduced motion: no scaling or sliding; app.js swaps springs for short cross-fades. */
@media (prefers-reduced-motion: reduce) {
  :root { --press-scale: 1; }
  .btn, .pressable, .doc-card, .sub-nav::after { transition: opacity 150ms ease, background-color 150ms ease !important; }
}
/* Reduced transparency: frosty glass becomes solid. */
@media (prefers-reduced-transparency: reduce) {
  :root { --chrome: #000000; --material: var(--bg-alt); --material-strong: var(--surface); }
  .global-nav, .sub-nav, .popover, .sheet, .format-bar, .toast, .proof-bar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
/* More contrast: solid surfaces and defined borders. */
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, 0.5); --line-strong: rgba(0, 0, 0, 0.7); --text-3: #3a3a3c; --material: var(--bg-alt); --material-strong: var(--surface); --chrome: #000000; }
  .btn-secondary, .btn-pearl, .chip, .select, .input { border-width: 1.5px; }
}

/* ------------------------------------------------------------------ proofing
   Marks are drawn with the CSS Custom Highlight API (see attachProofing in app.js). */
::highlight(whrick-spelling) { text-decoration: underline wavy #d42b2b; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-skip-ink: none; }
::highlight(whrick-grammar) { text-decoration: underline wavy #2a62d4; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-skip-ink: none; }
.proof-bar { position: fixed; right: calc(18px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); z-index: 30; display: flex; align-items: center; gap: 8px; background: var(--material-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); border-top-color: var(--material-edge); border-radius: var(--r-pill); padding: 5px 5px 5px 14px; box-shadow: var(--shadow-float); font-family: var(--font-text); font-size: 0.8125rem; max-width: calc(100vw - 20px); }
.proof-bar__label { font-weight: 600; color: var(--text); }
.proof-bar__lang { font: inherit; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); padding: 4px 10px; color: var(--text); min-height: 30px; }
.proof-bar__status { color: var(--text-3); white-space: nowrap; min-width: 4.5em; }
.proof-bar__status.has-issues { color: var(--danger); }
.proof-bar__next { font: inherit; border: 0; border-radius: var(--r-pill); background: var(--primary); color: #fff; padding: 6px 14px; min-height: 30px; cursor: pointer; transition: transform var(--press-time) ease-out; }
.proof-bar__next:active { transform: scale(var(--press-scale)); }
.proof-bar__next:disabled { background: var(--hover); color: var(--text-3); cursor: default; transform: none; }
.proof-menu__head { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; padding: 6px 10px 2px; }
.proof-menu__head.is-spelling { color: #d42b2b; }
.proof-menu__head.is-grammar { color: #2a62d4; }
@media (prefers-color-scheme: dark) { .proof-menu__head.is-spelling { color: #ff6961; } .proof-menu__head.is-grammar { color: #64a8ff; } }
.proof-menu__msg { padding: 0 10px 6px; color: var(--text); }
.proof-menu__suggestions { display: flex; flex-direction: column; }
.proof-menu__sugg { font-weight: 600; }
.proof-menu__none { padding: 6px 10px; color: var(--text-3); }
.sheet .proof-menu__head, .sheet .proof-menu__msg { padding-left: 14px; padding-right: 14px; }
.sheet .proof-menu__msg { font-size: 1.0625rem; }
.dict-list { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--sp-sm) 0; }
.dict-word { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px 2px 2px 12px; font-size: 0.875rem; }
.dict-word button { border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 1rem; line-height: 1; width: 30px; height: 30px; border-radius: var(--r-pill); }
.dict-word button:hover { background: var(--hover); color: var(--text); }
.dict-word button:active { background: var(--pressed); }
/* keep messages above the floating bars in the editor */
body:has(.proof-bar) .toast { bottom: calc(84px + var(--safe-b)); }
@media (max-width: 640px) {
  body:has(.format-bar) .toast { bottom: calc(124px + var(--safe-b)); }
  /* Proofing shrinks to a status pill above the format bar; the language is in the format sheet. */
  .proof-bar { left: 50%; right: auto; transform: translate(-50%, var(--kb, 0px)); bottom: calc(74px + var(--safe-b)); padding: 3px 3px 3px 12px; white-space: nowrap; gap: 6px; }
  .proof-bar__label, .proof-bar__lang { display: none; }
  .proof-bar__status { min-width: 0; }
  .proof-bar__next { white-space: nowrap; }
}

/* ------------------------------------------------------------------ objects: pictures and schedules */
/* Event colors: one hue per event name (app.js evColor). */
.ev-c0 { --ev: #0071e3; } .ev-c1 { --ev: #34a853; } .ev-c2 { --ev: #f08a00; } .ev-c3 { --ev: #8e44ef; } .ev-c4 { --ev: #e8457c; } .ev-c5 { --ev: #00a3a3; }
@media (prefers-color-scheme: dark) { .ev-c0 { --ev: #2997ff; } .ev-c1 { --ev: #4cd964; } .ev-c2 { --ev: #ffa733; } .ev-c3 { --ev: #b27dff; } .ev-c4 { --ev: #ff6b9a; } .ev-c5 { --ev: #3ad0d0; } }

.blk.obj { white-space: normal; position: relative; margin: 0.9em 0; border-radius: var(--r-md); font-family: var(--font-text); font-style: normal; caret-color: transparent; -webkit-user-select: none; user-select: none; }
.blk.obj.is-selected, .blk.obj:focus-within { outline: 2px solid var(--primary-focus); outline-offset: 4px; }
.obj-missing { padding: var(--sp-md); border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--text-3); font-size: 0.875rem; text-align: center; }
.obj-delete { color: var(--text-3); }
.obj-delete:hover { color: var(--danger); }

/* segmented control (일년 | 한달 | 한주 | 하루, 25% | 50% ...) */
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-pill); }
.seg__btn { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 0.8125rem; letter-spacing: -0.006em; padding: 5px 12px; min-height: 30px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; transition: background-color 120ms ease, color 120ms ease; }
.seg__btn:hover { color: var(--text); }
.seg__btn:active { transform: scale(var(--press-scale)); }
.seg__btn.is-on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg--lg .seg__btn { font-size: 0.9375rem; padding: 8px 22px; min-height: 38px; }

/* picture */
.obj-image { text-align: center; }
.obj-figure { position: relative; margin: 0 auto; max-width: 100%; }
.obj-figure img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); background: var(--bg-alt); }
.obj-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; align-items: center; padding: 4px; background: var(--material-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--shadow-float); opacity: 0; pointer-events: none; transition: opacity 140ms ease; }
.obj-tools .seg { background: transparent; border: 0; padding: 0; }
.obj-tools .btn-icon { width: 30px; height: 30px; min-height: 30px; box-shadow: none; }
.obj-image:hover .obj-tools, .obj-image.is-selected .obj-tools, .obj-image:focus-within .obj-tools { opacity: 1; pointer-events: auto; }

/* schedule */
.obj-schedule { background: var(--surface); border: 1px solid var(--line); padding: var(--sp-sm) var(--sp-sm) var(--sp-xs); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.cal-head { display: flex; align-items: center; gap: var(--sp-xs); flex-wrap: wrap; margin-bottom: var(--sp-sm); }
.cal-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 12rem; }
.cal-nav .btn-icon, .cal-head .obj-delete { width: 32px; height: 32px; min-height: 32px; box-shadow: none; }
.cal-title { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.012em; padding: 0 4px; white-space: nowrap; }
.cal-foot { font-size: 0.75rem; color: var(--text-3); text-align: right; padding: 6px 2px 0; }
.cal-ev { display: block; font-size: 0.75rem; line-height: 1.35; margin-top: 2px; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--ev) 15%, var(--surface)); box-shadow: inset 3px 0 0 var(--ev); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.35em; }
.cal-ev__time { font-variant-numeric: tabular-nums; color: var(--text-3); margin-right: 4px; }
.cal-ev__title { font-weight: 500; }

/* month */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-wd { font-size: 0.75rem; color: var(--text-3); text-align: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cal-wd.is-sun, .cal-day.is-sun .cal-num { color: #d70015; }
.cal-wd.is-sat, .cal-day.is-sat .cal-num { color: #0066cc; }
.cal-day { min-height: 5.5rem; padding: 3px 3px 5px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.is-out { background: var(--bg-alt); }
.cal-day.is-out .cal-num { opacity: 0.45; }
.cal-num { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 4px; border: 0; border-radius: var(--r-pill); background: none; color: var(--text); font: inherit; font-size: 0.8125rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.cal-num:hover { background: var(--hover); }
.cal-day.is-today .cal-num { background: var(--primary); color: #fff !important; font-weight: 600; }
.cal-month .cal-ev:not(.is-span) { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cal-ev.is-span:not(.is-start) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -4px; box-shadow: none; }
.cal-ev.is-span:not(.is-end) { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -4px; }
.cal-more { border: 0; background: none; color: var(--accent-text); font: inherit; font-size: 0.6875rem; padding: 2px 4px; cursor: pointer; }

/* year */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--sp-sm); }
.cal-mini-month { padding: 6px; border-radius: var(--r-md); border: 1px solid transparent; }
.cal-mini-month.has-ev { background: var(--bg-alt); }
.cal-mini__title { border: 0; background: none; font: inherit; font-family: var(--font-display); font-weight: 600; font-size: 0.9375rem; color: var(--text); padding: 2px 4px; border-radius: var(--r-sm); cursor: pointer; }
.cal-mini__title:hover { background: var(--hover); }
.cal-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin: 4px 0; font-size: 0.625rem; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-2); }
.cal-mini__d { line-height: 1.7; border-radius: var(--r-pill); }
.cal-mini__d.is-sun { color: #d70015; }
.cal-mini__d.has-ev { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--text); font-weight: 600; }
.cal-mini__d.is-today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.cal-mini__list { list-style: none; margin: 4px 0 0; padding: 0; font-size: 0.6875rem; line-height: 1.45; }
.cal-mini__list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; position: relative; }
.cal-mini__list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 5px; height: 5px; border-radius: 50%; background: var(--ev, var(--text-3)); }
.cal-mini__when { color: var(--text-3); font-variant-numeric: tabular-nums; }
.cal-mini__more { color: var(--text-3); }

/* week and day */
.cal-time { display: grid; grid-template-columns: 3.25rem repeat(var(--cols), minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-time__head { display: flex; flex-direction: column; align-items: center; gap: 0; border: 0; background: none; font: inherit; color: var(--text); padding: 6px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.cal-time__head:hover { background: var(--hover); }
.cal-time__wd { font-size: 0.6875rem; color: var(--text-3); }
.cal-time__date { font-size: 1.0625rem; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-pill); }
.cal-time__head.is-sun .cal-time__date { color: #d70015; }
.cal-time__head.is-sat .cal-time__date { color: #0066cc; }
.cal-time__head.is-today .cal-time__date { background: var(--primary); color: #fff; }
.cal-time__label { font-size: 0.625rem; color: var(--text-3); text-align: right; padding: 6px 6px 0 0; border-bottom: 1px solid var(--line); }
.cal-time__allday { min-height: 2rem; padding: 3px 2px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cal-time__hours { position: relative; }
.cal-time__hours span { position: absolute; right: 6px; font-size: 0.6875rem; color: var(--text-3); font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.cal-time__hours span:first-child { transform: none; }
.cal-time__col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); min-width: 0; }
.cal-time__col.is-today { background-color: color-mix(in srgb, var(--primary) 4%, transparent); }
.cal-block { position: absolute; overflow: hidden; border-radius: 7px; padding: 3px 6px; font-size: 0.75rem; line-height: 1.3; background: color-mix(in srgb, var(--ev) 18%, var(--surface)); box-shadow: inset 3px 0 0 var(--ev); color: var(--text); }
.cal-block__time { display: block; font-size: 0.6875rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cal-block__title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cal-block.is-short { white-space: nowrap; text-overflow: ellipsis; }
.cal-block.is-short .cal-block__time, .cal-block.is-short .cal-block__title { display: inline; margin-right: 4px; }
.cal-time.is-day .cal-block { font-size: 0.875rem; padding: 5px 10px; }
.cal-time.is-day .cal-block__time { font-size: 0.75rem; }
.cal-empty { grid-column: 1 / -1; text-align: center; color: var(--text-3); font-size: 0.875rem; padding: var(--sp-sm); }

/* insert menu */
.menu-label { font-size: 0.75rem; font-weight: 600; color: var(--text-3); padding: 6px 12px 0; letter-spacing: 0; }
.menu-hint { font-size: 0.75rem; color: var(--text-3); padding: 2px 12px 6px; margin: 0; line-height: 1.4; }
.menu-item__hint { margin-left: auto; padding-left: var(--sp-sm); color: var(--text-3); font-size: 0.75rem; }
.seg--menu { display: flex; margin: 2px 6px 6px; }
.popover .seg .seg__btn, .sheet .seg .seg__btn { width: auto; flex: 1; justify-content: center; min-height: 32px; padding: 5px 10px; border-radius: var(--r-pill); }
.sheet .seg--menu .seg__btn { min-height: var(--tap); font-size: 1rem; }
.sheet .menu-hint, .sheet .menu-label { padding-left: 14px; padding-right: 14px; }
.page.is-drop { outline: 2px dashed var(--primary-focus); outline-offset: -10px; }

/* documents: download links */
.doc-card__get { color: var(--text-3); display: inline-flex; gap: 8px; align-items: center; }

/* file conversion */
.convert { max-width: 820px; }
.convert-card { display: flex; flex-direction: column; gap: var(--sp-md); }
.convert-card__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm); flex-wrap: wrap; }
.convert-card__row .field__label { margin: 0; }
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 11rem; padding: var(--sp-lg); border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--bg-alt); color: var(--text); font: inherit; cursor: pointer; text-align: center; transition: border-color 120ms ease, background-color 120ms ease; }
.drop-zone:hover, .drop-zone.is-over { border-color: var(--primary-focus); background: var(--tint); }
.drop-zone__big { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.012em; }
.drop-zone__small { font-size: 0.8125rem; color: var(--text-3); }
.convert-list { list-style: none; margin: var(--sp-md) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-xs); }
.convert-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--sp-sm); align-items: center; padding: var(--sp-sm) var(--sp-md); }
.convert-item__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convert-item__arrow { font-size: 0.75rem; color: var(--text-3); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.convert-item__status { font-size: 0.8125rem; color: var(--text-3); overflow-wrap: anywhere; }
.convert-item.is-error .convert-item__status { color: var(--danger); }
.convert-item__actions { display: flex; gap: var(--sp-xs); justify-content: flex-end; }

@media (max-width: 640px) {
  .obj-schedule { padding: 8px 6px 4px; margin-left: -6px; margin-right: -6px; }
  .cal-nav { min-width: 0; }
  .cal-head .seg { order: 3; width: 100%; display: flex; }
  .cal-head .seg .seg__btn { flex: 1; min-height: 34px; }
  .cal-day { min-height: 4.25rem; padding: 2px 1px 3px; }
  .cal-num { min-width: 22px; height: 22px; font-size: 0.75rem; }
  .cal-ev { font-size: 0.625rem; padding: 0 3px; border-radius: 3px; box-shadow: inset 2px 0 0 var(--ev); }
  .cal-ev__time { display: none; }
  .cal-year { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .cal-time { grid-template-columns: 2.5rem repeat(var(--cols), minmax(0, 1fr)); }
  .cal-time:not(.is-day) .cal-block { padding: 2px 3px; font-size: 0.625rem; }
  .cal-time:not(.is-day) .cal-block__time { display: none; }
  .cal-time:not(.is-day) .cal-block.is-short { white-space: normal; }
  .cal-time:not(.is-day) .cal-time__date { font-size: 0.9375rem; min-width: 26px; height: 26px; }
  .obj-tools { opacity: 1; pointer-events: auto; position: static; margin: 8px auto 0; width: max-content; box-shadow: var(--shadow-chip); }
  .convert-item { grid-template-columns: 1fr; }
  .convert-item__actions { justify-content: flex-start; }
}
@media (pointer: coarse) {
  .obj-tools { opacity: 1; pointer-events: auto; }
  .seg__btn { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .seg__btn:active { transform: none; } }

/* ------------------------------------------------------------------ text colors and highlights (whrick_doc::marks) */
:root {
  --tc1: #d92d20; --tc2: #d9620b; --tc3: #1e8e3e; --tc4: #0b7f86; --tc5: #1a5fd0; --tc6: #8a3fd9; --tc7: #c92a6b; --tc8: #6e6e73;
  --hl1: #fff06a; --hl2: #b8f2a6; --hl3: #a9e8f7; --hl4: #ffc2e2; --hl5: #dcdce0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --tc1: #ff6b61; --tc2: #ff9f43; --tc3: #4cc777; --tc4: #3cc8cf; --tc5: #5c9dff; --tc6: #b896ff; --tc7: #ff7aae; --tc8: #a1a1a6;
    --hl1: #6b5d00; --hl2: #2f5e23; --hl3: #1d5866; --hl4: #6e2a4e; --hl5: #4a4a4f;
  }
}
.mk[data-c="1"] { color: var(--tc1); } .mk[data-c="2"] { color: var(--tc2); } .mk[data-c="3"] { color: var(--tc3); } .mk[data-c="4"] { color: var(--tc4); }
.mk[data-c="5"] { color: var(--tc5); } .mk[data-c="6"] { color: var(--tc6); } .mk[data-c="7"] { color: var(--tc7); } .mk[data-c="8"] { color: var(--tc8); }
.mk[data-h="1"] { background: var(--hl1); } .mk[data-h="2"] { background: var(--hl2); } .mk[data-h="3"] { background: var(--hl3); } .mk[data-h="4"] { background: var(--hl4); } .mk[data-h="5"] { background: var(--hl5); }
.mk[data-h]:not([data-h="0"]) { border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* 글자 색 / 형광펜 단추: 왼쪽은 마지막 색으로 칠하기, 오른쪽은 색 고르기 */
.markbtn { display: inline-flex; flex: none; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--shadow-chip); min-height: 34px; overflow: hidden; }
.markbtn button { border: 0; background: none; color: var(--text); cursor: pointer; font: inherit; }
.markbtn button:hover { background: var(--surface-2); }
.markbtn button:active { transform: scale(var(--press-scale)); }
.markbtn__main { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 8px 4px 12px; gap: 1px; }
.markbtn__glyph { font-size: 0.875rem; font-weight: 600; line-height: 1.1; }
.markbtn__glyph.is-hl { padding: 0 2px; border-radius: 2px; background: var(--hl1); }
.markbtn__bar { display: block; width: 16px; height: 3px; border-radius: 2px; background: var(--text); }
.markbtn[data-kind="h"] .markbtn__bar { display: none; }
.markbtn__bar[data-c="1"] { background: var(--tc1); } .markbtn__bar[data-c="2"] { background: var(--tc2); } .markbtn__bar[data-c="3"] { background: var(--tc3); } .markbtn__bar[data-c="4"] { background: var(--tc4); }
.markbtn__bar[data-c="5"] { background: var(--tc5); } .markbtn__bar[data-c="6"] { background: var(--tc6); } .markbtn__bar[data-c="7"] { background: var(--tc7); } .markbtn__bar[data-c="8"] { background: var(--tc8); }
.markbtn__more { width: 24px; padding: 0 8px 0 2px; position: relative; }
.markbtn__more::after { content: ""; position: absolute; left: 4px; top: 50%; margin-top: -2px; border: 4px solid transparent; border-top-color: var(--text-3); border-bottom: 0; }
.swatches { display: grid; grid-template-columns: repeat(5, 32px); gap: 8px; padding: 6px 8px 8px; }
.popover .swatch, .sheet .swatch, .swatch { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); cursor: pointer; display: block; }
.swatch:hover { transform: scale(1.08); }
.swatch[data-c="1"] { background: var(--tc1); } .swatch[data-c="2"] { background: var(--tc2); } .swatch[data-c="3"] { background: var(--tc3); } .swatch[data-c="4"] { background: var(--tc4); }
.swatch[data-c="5"] { background: var(--tc5); } .swatch[data-c="6"] { background: var(--tc6); } .swatch[data-c="7"] { background: var(--tc7); } .swatch[data-c="8"] { background: var(--tc8); }
.swatch[data-h="1"] { background: var(--hl1); } .swatch[data-h="2"] { background: var(--hl2); } .swatch[data-h="3"] { background: var(--hl3); } .swatch[data-h="4"] { background: var(--hl4); } .swatch[data-h="5"] { background: var(--hl5); }
.popover .swatch--none, .sheet .swatch--none, .swatch--none { background: linear-gradient(135deg, transparent 46%, var(--danger) 47%, var(--danger) 53%, transparent 54%), var(--surface); }
.sheet .swatches { grid-template-columns: repeat(5, 44px); gap: 12px; padding: 8px 4px 12px; }
.sheet .swatch { width: 44px; height: 44px; }

/* ------------------------------------------------------------------ tables and text boxes
   DESIGN.md: hairlines instead of shadows (1px rgba(0,0,0,0.08) on utility surfaces, #e0e0e0
   inside), parchment for header cells, one blue for focus and selection, 8px radius for
   compact utility controls, 11px for the object frames, pills for the choice chips, press at 0.95. */
:root {
  --hairline: #e0e0e0;
  --hairline-soft: rgba(0, 0, 0, 0.08);
  --cell-head: #f5f5f7;
  --cell-pick: rgba(0, 113, 227, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root { --hairline: #3a3a3c; --hairline-soft: rgba(255, 255, 255, 0.1); --cell-head: #242426; --cell-pick: rgba(41, 151, 255, 0.2); }
}

/* the tool bar above a table or a text box: a quiet strip, grouped, no shadow */
.obj-tools--bar { position: absolute; top: -48px; right: 0; z-index: 3; gap: 2px; padding: 4px; border-radius: var(--r-md); border: 1px solid var(--hairline-soft); background: var(--material-strong); box-shadow: none; transform: translateY(4px); transition: opacity 160ms ease, transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.obj-table:hover .obj-tools, .obj-table.is-selected .obj-tools, .obj-table:focus-within .obj-tools,
.obj-box:hover .obj-tools, .obj-box.is-selected .obj-tools, .obj-box:focus-within .obj-tools { opacity: 1; pointer-events: auto; transform: none; }
.tools-below > .obj-tools--bar { top: auto; bottom: -48px; }
.obj-tools__group { display: flex; align-items: center; gap: 2px; }
.obj-tools__group + .obj-tools__group { margin-left: 3px; padding-left: 5px; border-left: 1px solid var(--hairline-soft); }
.obj-tools__where { font-size: 0.75rem; font-weight: 600; color: var(--text-3); letter-spacing: 0; padding: 0 8px 0 6px; min-width: 4.6em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.obj-tools .obj-tool { width: 32px; height: 32px; min-height: 32px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text-2); box-shadow: none; transition: transform var(--press-time) ease-out, background-color 120ms ease, color 120ms ease; }
.obj-tools .obj-tool svg { width: 18px; height: 18px; }
.obj-tools .obj-tool:hover { background: var(--hover); color: var(--text); }
.obj-tools .obj-tool:active { transform: scale(0.95); background: var(--pressed); }
.obj-tools .obj-tool.is-on { background: var(--tint); color: var(--accent-text); }
.obj-tools .obj-tool:disabled { opacity: 0.35; background: transparent; }
.obj-tools .obj-tool.obj-delete:hover { color: var(--danger); }
.obj-tools .obj-tool:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 1px; }

.obj-table, .obj-box { caret-color: var(--primary); -webkit-user-select: text; user-select: text; }
.blk.obj.obj-table:focus-within, .blk.obj.obj-box:focus-within { outline: none; }
.blk.obj.obj-table.is-selected, .blk.obj.obj-box.is-selected { outline: 2px solid var(--primary-focus); outline-offset: 4px; }

/* the table: an 11px frame with hairlines between cells */
.utbl-wrap { position: relative; overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--page); }
.utbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--font-doc); font-size: 0.9375rem; line-height: 1.5; }
.utbl td, .utbl th { border: 1px solid var(--hairline); padding: 0; vertical-align: top; text-align: left; font-weight: 400; position: relative; transition: background-color 120ms ease; }
.utbl tr:first-child > * { border-top: 0; }
.utbl tr:last-child > * { border-bottom: 0; }
.utbl tr > :first-child { border-left: 0; }
.utbl tr > :last-child { border-right: 0; }
.utbl th { background: var(--cell-head); font-weight: 600; color: var(--text); }
.utbl__cell, .box-body { outline: none; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.5em; cursor: text; }
.utbl__cell { padding: 8px 12px; }
.utbl td:focus-within, .utbl th:focus-within { box-shadow: inset 0 0 0 2px var(--primary-focus); }
.utbl .is-picked { background: var(--cell-pick); box-shadow: none !important; }
.has-cells .utbl__cell { caret-color: transparent; }
.has-cells .utbl__cell::selection, .has-cells .utbl__cell *::selection { background: transparent; }

/* column resizing: a thin strip on each inner border, a blue line while hovered or dragged */
.utbl-handles { position: absolute; inset: 0 auto auto 0; width: 100%; height: 0; pointer-events: none; }
.utbl-handle { position: absolute; top: 0; width: 9px; cursor: col-resize; pointer-events: auto; touch-action: none; z-index: 1; }
.utbl-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 3px; border-radius: 2px; background: var(--primary-focus); opacity: 0; transition: opacity 120ms ease; }
.utbl-handle:hover::after, .utbl-handle.is-on::after { opacity: 1; }
.is-resizing, .is-resizing * { cursor: col-resize !important; -webkit-user-select: none !important; user-select: none !important; }

/* text boxes: 11px frame, hairline border, soft fill per look */
.obj-box { border: 1px solid var(--box-line, var(--hairline)); background: var(--box-fill, var(--page)); padding: 14px 18px; font-family: var(--font-doc); border-radius: var(--r-md); }
.obj-box[data-look="line"] { --box-line: #c7c7cc; }
.obj-box[data-look="yellow"] { --box-line: #ecd78a; --box-fill: #fffaeb; }
.obj-box[data-look="blue"] { --box-line: #b5d2f5; --box-fill: #f0f6fe; }
.obj-box[data-look="green"] { --box-line: #b4e0bf; --box-fill: #f0f9f2; }
.obj-box[data-look="gray"] { --box-line: #dcdce0; --box-fill: #f5f5f7; }
.obj-box:focus-within { border-color: var(--primary-focus); box-shadow: 0 0 0 1px var(--primary-focus); }
@media (prefers-color-scheme: dark) {
  .obj-box[data-look="line"] { --box-line: #5a5a5f; }
  .obj-box[data-look="yellow"] { --box-line: #7d6a2a; --box-fill: #2e2812; }
  .obj-box[data-look="blue"] { --box-line: #345c92; --box-fill: #14223a; }
  .obj-box[data-look="green"] { --box-line: #356f47; --box-fill: #13281a; }
  .obj-box[data-look="gray"] { --box-line: #48484a; --box-fill: #242426; }
}
.box-body { line-height: 1.6; }
.box-body.is-empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; float: left; height: 0; }

/* the look dots in the box tools */
.seg--looks { gap: 4px; padding: 0 2px; }
.look-dot { width: 24px; min-width: 24px; height: 24px; min-height: 24px !important; padding: 0 !important; border-radius: 50% !important; border: 1px solid var(--box-line, var(--hairline)) !important; background: var(--box-fill, var(--page)) !important; box-shadow: none !important; transition: transform var(--press-time) ease-out; }
.look-dot:active { transform: scale(0.95); }
.look-dot.is-on { box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--primary-focus) !important; }
.look-dot[data-look="line"], .bmaker__tile[data-look="line"] { --box-line: #a1a1a6; --box-fill: #ffffff; }
.look-dot[data-look="yellow"], .bmaker__tile[data-look="yellow"] { --box-line: #e3c75f; --box-fill: #fff6d6; }
.look-dot[data-look="blue"], .bmaker__tile[data-look="blue"] { --box-line: #8db8f2; --box-fill: #e6f0fd; }
.look-dot[data-look="green"], .bmaker__tile[data-look="green"] { --box-line: #8fd09f; --box-fill: #e5f5e9; }
.look-dot[data-look="gray"], .bmaker__tile[data-look="gray"] { --box-line: #c7c7cc; --box-fill: #eeeef0; }
@media (prefers-color-scheme: dark) {
  .look-dot[data-look="line"], .bmaker__tile[data-look="line"] { --box-line: #8e8e93; --box-fill: #1d1d1f; }
  .look-dot[data-look="yellow"], .bmaker__tile[data-look="yellow"] { --box-line: #9c8430; --box-fill: #3a3214; }
  .look-dot[data-look="blue"], .bmaker__tile[data-look="blue"] { --box-line: #3f6faf; --box-fill: #16263c; }
  .look-dot[data-look="green"], .bmaker__tile[data-look="green"] { --box-line: #3f8a55; --box-fill: #15301e; }
  .look-dot[data-look="gray"], .bmaker__tile[data-look="gray"] { --box-line: #5a5a5f; --box-fill: #2c2c2e; }
}

/* ---- making a table: size grid, header switches, typed size */
.popover:has(.tmaker) { max-width: 22rem; }
.popover { max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
.tmaker { padding: 2px 8px 8px; }
.tpick-wrap { padding: 6px 0 0; display: flex; flex-direction: column; gap: 8px; }
.tpick { display: grid; grid-template-columns: repeat(8, 20px); gap: 4px; width: max-content; }
.popover .tpick__cell, .sheet .tpick__cell, .tpick__cell { width: 20px; height: 20px; min-height: 20px; padding: 0; border: 1px solid var(--hairline); border-radius: var(--r-xs); background: var(--surface-2); cursor: pointer; transition: background-color 80ms ease, border-color 80ms ease; }
.popover .tpick__cell:hover, .tpick__cell:hover { background: var(--surface-2); }
.popover .tpick__cell.is-on, .sheet .tpick__cell.is-on, .tpick__cell.is-on { background: var(--tint); border-color: var(--primary-focus); }
.popover .tpick__cell:focus-visible, .tpick__cell:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 1px; }
.tpick__label { font-size: 0.8125rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tmaker__row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.popover .tmaker .chip, .sheet .tmaker .chip { width: auto; display: inline-flex; justify-content: center; min-height: 30px; padding: 5px 14px; font-size: 0.8125rem; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--surface-2); color: var(--text-2); box-shadow: none; transition: transform var(--press-time) ease-out; }
.popover .tmaker .chip:active, .sheet .tmaker .chip:active { transform: scale(0.95); }
.popover .tmaker .chip.is-on, .sheet .tmaker .chip.is-on { background: var(--tint); color: var(--accent-text); border-color: var(--primary-focus); font-weight: 600; }
.tsize { padding-top: 10px; border-top: 1px solid var(--hairline-soft); }
.tsize__num { width: 4.2em; min-height: 32px; padding: 4px 10px; font: inherit; font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--text); background: var(--surface); border: 1px solid var(--hairline-soft); border-radius: var(--r-sm); }
.tsize__num:focus { outline: none; border-color: var(--primary-focus); box-shadow: 0 0 0 3px var(--tint); }
.tsize__x { color: var(--text-3); font-size: 0.8125rem; }
.popover .tsize__go, .sheet .tsize__go { width: auto; margin-left: auto; min-height: 32px; padding: 6px 16px; font-size: 0.875rem; border-radius: var(--r-pill); color: var(--on-accent); background: var(--primary); justify-content: center; }
.popover .tsize__go:hover, .sheet .tsize__go:hover { background: var(--primary-focus); }
.popover .tsize__go:active, .sheet .tsize__go:active { transform: scale(0.95); background: var(--primary); }

/* ---- making a text box: one tile per look */
.bmaker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 6px 8px 8px; }
.popover .bmaker__tile, .sheet .bmaker__tile, .bmaker__tile { display: flex; flex-direction: column; align-items: center; gap: 6px; width: auto; min-height: 0; padding: 6px 2px; border-radius: var(--r-sm); background: none; border: 0; cursor: pointer; transition: transform var(--press-time) ease-out, background-color 120ms ease; }
.popover .bmaker__tile:hover, .bmaker__tile:hover { background: var(--hover); }
.popover .bmaker__tile:active, .bmaker__tile:active { transform: scale(0.95); }
.bmaker__swatch { width: 44px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--box-line); background: var(--box-fill); display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 8px; }
.bmaker__swatch i { display: block; height: 2px; border-radius: 1px; background: var(--box-line); }
.bmaker__swatch i:nth-child(2) { width: 75%; }
.bmaker__swatch i:nth-child(3) { width: 50%; }
.bmaker__name { font-size: 0.6875rem; color: var(--text-2); letter-spacing: 0; white-space: nowrap; }

@media (pointer: coarse) {
  .tpick { grid-template-columns: repeat(8, 30px); gap: 6px; }
  .popover .tpick__cell, .sheet .tpick__cell, .tpick__cell { width: 30px; height: 30px; min-height: 30px; }
  .obj-tools .obj-tool { width: 40px; height: 40px; min-height: 40px; }
  .utbl-handle { width: 17px; }
  .utbl-handle::after { left: 7px; }
  .sheet .tsize__num, .sheet .tmaker .chip, .sheet .tsize__go { min-height: var(--tap); }
}
/* small or touch screens: the table and box tools sit above them in the flow, always shown */
@media (max-width: 640px), (pointer: coarse) {
  .obj-table .obj-tools, .obj-box .obj-tools { opacity: 1; pointer-events: auto; position: static; transform: none; margin: 0 0 8px auto; width: max-content; max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .obj-tools__where { display: none; }
}
@media (prefers-contrast: more) {
  :root { --hairline: #8e8e93; --hairline-soft: rgba(0, 0, 0, 0.3); }
}
@media (prefers-reduced-motion: reduce) {
  .swatch:hover { transform: none; } .markbtn button:active { transform: none; }
  .obj-tools--bar { transition: none; transform: none; }
  .obj-tools .obj-tool:active, .look-dot:active, .bmaker__tile:active, .tmaker .chip:active, .tsize__go:active { transform: none; }
}

/* ------------------------------------------------------------------ AI detection mode */
::highlight(whrick-ai-strong) { background-color: rgba(255, 140, 0, 0.30); text-decoration: underline solid #d96a00; text-decoration-thickness: 2px; text-underline-offset: 3px; }
::highlight(whrick-ai-medium) { background-color: rgba(255, 170, 0, 0.18); }
::highlight(whrick-ai-weak) { text-decoration: underline dotted #c98a00; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ai-toggle.is-on { background: #fff1e0; border-color: #f0a640; color: #8a4b00; }
.ai-panel { position: fixed; z-index: 29; top: calc(var(--nav-h) + var(--subnav-h) + 16px); right: calc(16px + var(--safe-r)); width: 340px; max-height: calc(100dvh - var(--nav-h) - var(--subnav-h) - 110px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-float); font-family: var(--font-text); font-size: 0.8125rem; color: var(--text); overflow: hidden; }
.ai-panel.hidden { display: none; }
.ai-panel__top { display: flex; align-items: center; gap: 4px; padding: 10px 10px 4px 14px; }
.ai-panel__head { flex: 1; display: flex; align-items: baseline; gap: 8px; border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; text-align: left; }
.ai-panel__title { font-weight: 600; }
.ai-panel__pct { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ai-panel__level { font-weight: 600; padding: 1px 8px; border-radius: var(--r-pill); }
.lv-high { color: #b3261e; background: #fde7e5; }
.lv-mid { color: #8a4b00; background: #fff1e0; }
.lv-low { color: #1b6e2f; background: #e4f5e8; }
.ai-panel__close { border: 0; background: var(--hover); color: var(--text-3); width: 26px; height: 26px; border-radius: 50%; font: inherit; cursor: pointer; }
.ai-meter { height: 6px; margin: 2px 14px 6px; background: var(--hover); border-radius: var(--r-pill); overflow: hidden; }
.ai-meter__fill { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.3s ease-out; }
.ai-meter__fill.lv-high { background: #d93025; }
.ai-meter__fill.lv-mid { background: #f29900; }
.ai-meter__fill.lv-low { background: #34a853; }
.ai-panel__conf { color: var(--text-3); padding: 0 14px 8px; }
.ai-panel__body { overflow-y: auto; padding: 0 14px 12px; overscroll-behavior: contain; }
.ai-panel.is-collapsed .ai-panel__body, .ai-panel.is-collapsed .ai-panel__conf, .ai-panel.is-collapsed .chk-mode { display: none; }
.ai-signals { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.ai-signal { padding: 2px 8px; border-radius: var(--r-pill); background: var(--hover); color: var(--text-2); }
.ai-signal.sev-strong { background: #fde2c8; color: #8a3b00; }
.ai-signal.sev-medium { background: #fff1d6; color: #7a5200; }
.ai-sec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.ai-sec__title { font-size: 0.8125rem; font-weight: 600; margin: 0 0 6px; }
.ai-mark { border-left: 3px solid #e6b800; padding: 4px 0 6px 8px; margin-bottom: 6px; }
.ai-mark.sev-strong { border-left-color: #d96a00; }
.ai-mark.sev-medium { border-left-color: #f0a640; }
.ai-mark__word { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; text-align: left; }
.ai-mark__text { font-weight: 600; }
.ai-mark__count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.ai-mark__cat { color: var(--text-3); font-size: 0.75rem; }
.ai-mark__reason, .ai-mark__hint { color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.ai-mark__hint { color: var(--text-3); }
.ai-mark__reps { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.ai-rep, .ai-alt__apply { font: inherit; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent-text); border-radius: var(--r-pill); padding: 2px 10px; min-height: 26px; cursor: pointer; }
.ai-rep:hover, .ai-alt__apply:hover { background: var(--tint); }
.ai-sent { margin-bottom: 10px; }
.ai-sent__orig { display: flex; gap: 6px; border: 0; background: none; font: inherit; color: var(--text-2); padding: 0; text-align: left; cursor: pointer; line-height: 1.45; }
.ai-sent__score, .ai-alt__score { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2.6em; }
.ai-sent__score { color: #b3261e; }
.ai-alt { display: flex; align-items: flex-start; gap: 6px; margin-top: 5px; padding: 6px 8px; background: var(--bg-alt); border-radius: var(--r-sm); line-height: 1.45; }
.ai-alt__score { color: #1b6e2f; }
.ai-alt__text { flex: 1; }
.ai-alt__apply { flex: none; }
.ai-metrics summary { cursor: pointer; font-weight: 600; }
.ai-metric { display: flex; justify-content: space-between; padding: 2px 0; color: var(--text-2); }
.ai-panel__empty { color: var(--text-3); margin: 4px 0 8px; }
.ai-panel__notice { color: var(--text-3); font-size: 0.75rem; line-height: 1.45; margin: 10px 0 0; }
.ai-menu__head { color: #b35a00; }
/* font size (5 ~ 128pt), line and word spacing */
.fsize { display: inline-flex; align-items: center; flex: none; height: 34px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); padding: 0 2px; }
.fsize__btn { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--text); font: 600 1rem/1 var(--font-text); cursor: pointer; }
.fsize__btn:hover { background: var(--hover); }
.fsize__input { width: 3.2em; border: 0; background: none; text-align: right; font: 500 0.875rem var(--font-text); color: var(--text); padding: 0 1px; font-variant-numeric: tabular-nums; }
.fsize__input:focus { outline: none; }
.fsize:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.fsize__unit { font-size: 0.75rem; color: var(--text-3); margin-right: 2px; }
.sheet .fsize { height: 40px; }
.sheet .fsize__btn { width: 36px; height: 36px; }
.space-btn { flex: none; }
.space-row { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 12px; min-width: 260px; max-width: 360px; }
.space-row__head { display: flex; align-items: baseline; gap: 8px; }
.space__name { font-weight: 600; font-size: 0.8125rem; }
.space__value { flex: 1; font-variant-numeric: tabular-nums; color: var(--primary); font-weight: 600; font-size: 0.8125rem; }
.popover .space__reset, .space__reset { width: auto; min-height: 26px; padding: 2px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font-size: 0.75rem; cursor: pointer; }
.space__track { position: relative; height: 28px; display: flex; align-items: center; }
.space__tick { position: absolute; top: 50%; width: 2px; height: 12px; margin: -6px 0 0 -1px; border-radius: 1px; background: var(--text-3); pointer-events: none; }
.space__slider { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --fill: 0%; }
.space__slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary) var(--fill), var(--hover) var(--fill)); }
.space__slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--hover); }
.space__slider::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--primary); }
.space__slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); position: relative; z-index: 1; }
.space__slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.space__slider:focus-visible { outline: none; }
.space__slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.space__ends { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sheet .space-row { max-width: none; min-width: 0; }
/* document check: AI / plagiarism modes */
::highlight(whrick-plag) { background-color: rgba(217, 48, 37, 0.16); text-decoration: underline solid #c5221f; text-decoration-thickness: 2px; text-underline-offset: 3px; }
::highlight(whrick-quote) { background-color: rgba(26, 115, 232, 0.12); }
.chk-mode { display: flex; gap: 2px; margin: 4px 14px 8px; padding: 2px; background: var(--hover); border-radius: var(--r-pill); }
.chk-mode__btn { flex: 1; border: 0; background: none; font: inherit; color: var(--text-2); padding: 4px 0; min-height: 28px; border-radius: var(--r-pill); cursor: pointer; }
.chk-mode__btn[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.chk-scores { display: flex; flex-direction: column; gap: 2px; }
.chk-score.hidden { display: none; }
.chk-score__row { display: flex; align-items: baseline; gap: 8px; padding: 0 14px; }
.chk-score__label { font-weight: 600; min-width: 4.2em; }
.chk-score .ai-panel__pct { font-size: 1.35rem; }
.chk-part + .chk-part { border-top: 2px solid var(--line); margin-top: 12px; padding-top: 4px; }
.chk-part__title { font-size: 0.875rem; font-weight: 700; margin: 6px 0; }
.chk-det__sum { color: var(--text-3); margin: 0 0 6px; line-height: 1.45; }
.chk-table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.chk-table td { padding: 4px 4px 4px 0; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.4; }
.chk-table tr.is-off td { color: var(--text-3); }
.chk-det__name { white-space: nowrap; font-weight: 600; }
.chk-det__score { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; padding-right: 8px !important; }
.chk-det__note { color: var(--text-3); font-size: 0.75rem; }
.chk-deep { margin: 2px 0 8px; }
.chk-src { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; }
.chk-src__kind { flex: none; font-size: 0.6875rem; padding: 0 6px; border-radius: var(--r-pill); background: var(--hover); color: var(--text-2); }
.chk-src__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk-src__num { flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chk-src__del { flex: none; border: 0; background: none; color: var(--text-3); cursor: pointer; font: inherit; padding: 0 4px; }
.chk-match { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid #c5221f; background: none; font: inherit; color: inherit; padding: 3px 0 5px 8px; margin-bottom: 4px; cursor: pointer; }
.chk-match.kind-paraphrase { border-left-color: #f29900; }
.chk-match.kind-quote { border-left-color: #1a73e8; }
.chk-match__meta { display: block; color: var(--text-3); font-size: 0.75rem; }
.chk-match__text { display: block; color: var(--text-2); line-height: 1.45; }
.chk-lib summary { cursor: pointer; font-weight: 600; }
.chk-lib__docs { display: flex; align-items: center; gap: 6px; margin: 6px 0; cursor: pointer; }
.chk-lib__add { margin: 6px 0; }
.chk-lib__input, .chk-lib__text { display: block; width: 100%; box-sizing: border-box; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 8px; margin-bottom: 5px; }
.chk-lib__text { resize: vertical; min-height: 60px; }
@media (min-width: 1069px) { body.ai-on .canvas { padding-right: calc(var(--gutter) + 360px); } }
@media (max-width: 1068px) {
  .ai-panel { top: auto; bottom: calc(132px + var(--safe-b)); left: 10px; right: 10px; width: auto; max-height: 42dvh; transform: translateY(var(--kb, 0px)); }
}
@media (prefers-color-scheme: dark) {
  .lv-high { color: #ff8a80; background: rgba(217, 48, 37, 0.22); }
  .lv-mid { color: #ffc266; background: rgba(242, 153, 0, 0.2); }
  .lv-low { color: #7fd99a; background: rgba(52, 168, 83, 0.2); }
  .ai-signal.sev-strong { background: rgba(217, 106, 0, 0.28); color: #ffb870; }
  .ai-signal.sev-medium { background: rgba(240, 166, 64, 0.2); color: #ffd28a; }
  .ai-toggle.is-on { background: rgba(240, 166, 64, 0.2); border-color: #b87522; color: #ffc266; }
  .ai-sent__score { color: #ff8a80; }
  .ai-alt__score { color: #7fd99a; }
  .ai-menu__head { color: #ffb870; }
}

/* ------------------------------------------------------------------ collaboration */
.pc-0 { --pc: #e5484d; } .pc-1 { --pc: #f76b15; } .pc-2 { --pc: #2b9a66; } .pc-3 { --pc: #0090ff; }
.pc-4 { --pc: #8e4ec6; } .pc-5 { --pc: #d6409f; } .pc-6 { --pc: #12a594; } .pc-7 { --pc: #a18072; }
::highlight(whrick-peer-0) { background-color: rgba(229, 72, 77, 0.22); } ::highlight(whrick-peer-1) { background-color: rgba(247, 107, 21, 0.22); }
::highlight(whrick-peer-2) { background-color: rgba(43, 154, 102, 0.22); } ::highlight(whrick-peer-3) { background-color: rgba(0, 144, 255, 0.22); }
::highlight(whrick-peer-4) { background-color: rgba(142, 78, 198, 0.22); } ::highlight(whrick-peer-5) { background-color: rgba(214, 64, 159, 0.22); }
::highlight(whrick-peer-6) { background-color: rgba(18, 165, 148, 0.22); } ::highlight(whrick-peer-7) { background-color: rgba(161, 128, 114, 0.22); }
::highlight(whrick-discuss) { background-color: rgba(255, 196, 0, 0.26); text-decoration: underline dashed #c99400; text-underline-offset: 4px; }
::highlight(whrick-discuss-active) { background-color: rgba(255, 176, 0, 0.5); text-decoration: underline solid #b07800; text-underline-offset: 4px; }
.peer-layer { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.peer-caret { position: fixed; width: 2px; background: var(--pc); border-radius: 1px; }
.peer-caret__name { position: absolute; left: -1px; bottom: 100%; margin-bottom: 1px; background: var(--pc); color: #fff; font: 600 0.6875rem/1.5 var(--font-text); padding: 0 5px; border-radius: 4px 4px 4px 0; white-space: nowrap; }
.page.is-connecting { opacity: 0.7; }
.page.is-connecting::after { content: "공동 작업 서버에 연결하는 중..."; display: block; color: var(--text-3); font: 0.8125rem var(--font-text); margin-top: 12px; }

.collab-toggle { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.collab-toggle.is-on { background: var(--tint); border-color: var(--primary); color: var(--accent-text); }
.collab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.collab-dot.is-on { background: #2b9a66; } .collab-dot.is-off { background: var(--danger); } .collab-dot.is-wait { background: #f5a623; }
.collab-faces { display: inline-flex; }
.collab-faces:empty { display: none; }
.face { width: 20px; height: 20px; border-radius: 50%; background: var(--pc); color: #fff; font: 600 0.6875rem/20px var(--font-text); text-align: center; margin-left: -5px; border: 2px solid var(--surface); }
.face:first-child { margin-left: 0; }
.collab-badge, .tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 600 0.6875rem/18px var(--font-text); text-align: center; }
.collab-badge { position: absolute; top: -6px; right: -6px; }
.tab-badge { margin-left: 4px; display: inline-block; }
.collab-badge.hidden, .tab-badge.hidden, .collab-panel.hidden, .collab-pane.hidden, .discuss-btn.hidden { display: none; }
.collab-panel { position: fixed; z-index: 29; top: calc(var(--nav-h) + var(--subnav-h) + 16px); right: calc(16px + var(--safe-r)); width: 340px; height: calc(100dvh - var(--nav-h) - var(--subnav-h) - 110px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-float); font-family: var(--font-text); font-size: 0.8125rem; color: var(--text); overflow: hidden; }
.collab-panel__top { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 2px 14px; }
.collab-panel__title { font-size: 0.9375rem; }
.collab-status { color: var(--text-3); padding: 0 14px 8px; }
.collab-tabs { margin: 0 12px 8px; display: flex; }
.collab-tabs .seg__btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; }
.collab-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 14px 12px; overflow-y: auto; overscroll-behavior: contain; }
.collab-empty { color: var(--text-3); margin: 12px 0; line-height: 1.5; }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 0; overscroll-behavior: contain; }
.chat-msg { padding: 6px 0; }
.chat-msg__head { display: flex; align-items: baseline; gap: 8px; }
.who { color: var(--pc); font-weight: 600; }
.chat-msg__time { color: var(--text-3); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.chat-msg__text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; margin-top: 2px; }
.chat-compose { display: flex; gap: 6px; align-items: flex-end; padding-top: 8px; border-top: 1px solid var(--line); }
.chat-input { flex: 1; resize: none; min-height: 40px; max-height: 120px; font: inherit; }
.thread-head { padding-bottom: 6px; }
.thread-tip { color: var(--text-3); margin: 0 0 6px; line-height: 1.45; }
.thread-filter { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.thread { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; margin-top: 8px; background: var(--surface); }
.thread.is-active { border-color: #e0a100; box-shadow: 0 0 0 2px rgba(255, 176, 0, 0.25); }
.thread.is-resolved { opacity: 0.65; }
.thread-quote-row { display: flex; align-items: stretch; gap: 6px; }
.thread-quote-row .thread-quote { flex: 1; min-width: 0; }
.thread-jump { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; min-height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--primary); cursor: pointer; }
.thread-jump:hover { background: var(--tint, #eef4ff); }
.thread-jump:disabled { color: var(--text-3); cursor: default; opacity: 0.5; }
.thread-jump:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::highlight(whrick-jump) { background-color: rgba(0, 102, 204, 0.28); }
.thread-quote { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid #e0a100; background: rgba(255, 196, 0, 0.12); padding: 4px 8px; font: inherit; color: var(--text-2); border-radius: 4px; cursor: pointer; line-height: 1.45; }
.thread-lost { color: var(--danger); font-style: normal; }
.thread-comment { padding: 6px 0 0; }
.thread-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.thread-reply { flex: 1 1 100%; resize: none; min-height: 34px; font: inherit; }
.link-btn.danger { color: var(--danger); }
.people-sec { padding: 6px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.people-sec__title { font-size: 0.8125rem; margin: 4px 0 8px; }
.join-code-row { display: flex; align-items: center; gap: 8px; }
.join-code { font: 700 1.5rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.12em; padding: 6px 10px; border-radius: var(--r-sm); background: var(--bg-alt); user-select: all; }
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.person__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; }
.person__name { flex: 1; }
.person__role { color: var(--text-3); font-size: 0.75rem; }
/* access: 대기 모드 / 확장 모드 and the waiting list */
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.access-row .people-sec__title { margin-bottom: 2px; }
.access-row p { margin: 0; }
.switch { position: relative; flex: none; width: 46px; height: 28px; border: 0; padding: 0; border-radius: 14px; background: #c7c7cc; cursor: pointer; transition: background 0.2s; }
.switch.is-on { background: #34c759; }
.switch__knob { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch.is-on .switch__knob { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.access-pending { background: var(--tint, #eef4ff); border-radius: var(--r-sm); padding: 6px 8px 8px; border-bottom: 0; }
.person__actions { display: flex; align-items: center; gap: 6px; flex: none; }
.person__when { color: var(--text-3); font-size: 0.75rem; }
.access-wait .join-form__title { display: flex; align-items: center; gap: 8px; }
.access-wait__dot { width: 10px; height: 10px; border-radius: 50%; background: #f29900; animation: access-pulse 1.4s ease-in-out infinite; }
.access-wait__dot.is-off { background: var(--danger, #d93025); animation: none; }
@keyframes access-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .access-wait__dot { animation: none; } .switch, .switch__knob { transition: none; } }
.muted.small, .small { font-size: 0.75rem; line-height: 1.45; }
.discuss-btn { position: fixed; z-index: 31; font: 600 0.8125rem var(--font-text); background: #1d1d1f; color: #fff; border: 0; border-radius: var(--r-pill); padding: 7px 14px; box-shadow: var(--shadow-float); cursor: pointer; }
.discuss-form { display: flex; flex-direction: column; gap: 8px; padding: 6px; width: min(340px, 86vw); }
.discuss-form textarea { font: inherit; resize: vertical; }
.discuss-quote { margin: 0; border-left: 3px solid #e0a100; padding: 4px 8px; background: rgba(255, 196, 0, 0.12); color: var(--text-2); max-height: 6em; overflow: auto; font-size: 0.8125rem; }
.discuss-form__row { display: flex; justify-content: flex-end; }
.doc-card__share { color: var(--accent-text); font-size: 0.75rem; margin-top: 2px; }
.join-form { display: flex; flex-direction: column; gap: 10px; padding: 8px; width: min(320px, 86vw); }
.join-input { font: 700 1.25rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.18em; text-transform: uppercase; text-align: center; }
.join-preview { margin: 0; text-align: center; font-variant-numeric: tabular-nums; }
@media (min-width: 1069px) { body.collab-open .canvas { padding-right: calc(var(--gutter) + 360px); } body.collab-open.ai-on .ai-panel { right: calc(16px + var(--safe-r) + 352px); } body.collab-open.ai-on .canvas { padding-right: calc(var(--gutter) + 700px); } }
@media (max-width: 1068px) {
  .collab-panel { top: auto; bottom: calc(74px + var(--safe-b)); left: 8px; right: 8px; width: auto; height: min(60dvh, 520px); transform: translateY(var(--kb, 0px)); }
  .collab-toggle__label { display: none; }
}
@media (prefers-color-scheme: dark) {
  .discuss-btn { background: #f5f5f7; color: #1d1d1f; }
  ::highlight(whrick-discuss) { background-color: rgba(255, 196, 0, 0.2); }
}
/* real buttons inside a popover keep their look (join form, discussion form) */
.popover .join-form .btn, .popover .discuss-form .btn, .sheet .join-form .btn, .sheet .discuss-form .btn { width: auto; justify-content: center; color: var(--on-accent); background: var(--primary); padding: 9px 18px; border-radius: var(--r-pill); font-size: 0.9375rem; }
.popover .join-form .btn:hover, .popover .discuss-form .btn:hover { background: var(--primary-focus); }
.popover .join-form .btn:disabled, .popover .discuss-form .btn:disabled { opacity: 0.6; }
.join-form__title { font-size: 0.9375rem; margin: 0; }
.popover:has(.join-form), .popover:has(.discuss-form) { max-width: 24rem; }

/* ------------------------------------------------------------------ 스타일 참조
   The PDF slots use the same face (Gothic A1, all of it) as the text the server draws into the
   downloaded PDF, so what you type takes the same room on screen and on paper. */
@font-face { font-family: "Whrick Form"; src: url("/GothicA1-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Whrick Form"; src: url("/GothicA1-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }

   The page is the product: white paper with the system product shadow on a parchment stage.
   Typing boxes stay invisible until hovered or focused (one blue for focus, DESIGN.md). */
.forms-section { margin-bottom: var(--sp-xl); }
.forms-section__title { font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.012em; margin: 0 0 4px; }
.forms-section .muted { margin: 0 0 var(--sp-md); }
.form-thumb { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 9%; padding: 18% 14%; width: 100%; aspect-ratio: 210 / 297; background: #fff; border-radius: 3px; box-shadow: var(--product-shadow); }
.form-thumb i { display: block; height: 7%; border: 1px solid #c7c7cc; border-radius: 2px; }
.form-thumb i:nth-child(3) { width: 70%; }
.form-thumb__kind { position: absolute; top: 8px; left: 8px; font-size: 0.6875rem; font-weight: 600; color: #fff; background: #2b579a; border-radius: var(--r-pill); padding: 2px 8px; }

body.is-form .footer { display: none; }
.form-head { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.form-badge { flex: none; font-size: 0.75rem; font-weight: 600; color: var(--accent-text); background: var(--tint); border-radius: var(--r-pill); padding: 3px 10px; }
.form-title { min-width: 0; flex: 1; }
.form-zoom { width: auto; min-width: 5.5rem; }
.fwrap { background: var(--bg-alt); min-height: calc(100dvh - var(--nav-h) - var(--subnav-h)); padding: var(--sp-md) 0 var(--sp-section); }
.fhint { max-width: 46rem; margin: 0 auto var(--sp-md); padding: 0 var(--gutter); text-align: center; }
.fstage { overflow-x: auto; padding: 0 16px; }
.fpages { --k: 1.333; display: flex; flex-direction: column; align-items: center; gap: 24px; width: max-content; min-width: 100%; margin: 0 auto; }
.fpage { position: relative; flex: none; background: #fff; color: #000; box-shadow: var(--product-shadow); border-radius: 2px; }
.fpage__bg { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-user-select: none; user-select: none; pointer-events: none; }
.fpage.is-broken::after { content: "쪽 그림을 불러오지 못했습니다"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6e6e73; font-size: 0.875rem; }

/* a place to type: invisible until hovered, blue when focused */
.fslot { position: relative; outline: none; cursor: text; caret-color: #0071e3; border-radius: 2px; transition: background-color 120ms ease, box-shadow 120ms ease; overflow-wrap: anywhere; }
.fslot:hover { background: rgba(0, 113, 227, 0.06); box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.35); }
.fslot:focus { background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 2px #0071e3; }
.fslot.is-empty::before { content: attr(data-ph); position: absolute; left: 0; right: 0; top: 0; color: inherit; opacity: 0.36; pointer-events: none; white-space: inherit; text-align: inherit; text-indent: inherit; overflow: visible; }
.hide-ph .fslot.is-empty::before { display: none; }
.fslot--pdf { position: absolute; white-space: pre; line-height: 1.25; min-height: 1.25em; padding: 0 1px; margin-left: -1px; font-family: "Whrick Form", "Gothic A1", var(--font-ui); font-weight: 400; z-index: 1; }
.fslot--pdf.is-bold { font-weight: 600; }
.fslot--pdf:focus { z-index: 3; }
.fslot--docx { display: block; white-space: pre-wrap; min-height: 1.2em; min-height: 1lh; }
.fslot-probe { position: absolute; left: -9999px; top: 0; visibility: hidden; font: 400 100px/1.25 "Whrick Form", "Gothic A1", sans-serif; white-space: nowrap; }
.fslot-probe__mark { display: inline-block; width: 1px; height: 0; vertical-align: baseline; }

/* Word pages: paragraphs, tables and floating boxes drawn from the document */
.fpage--docx { box-sizing: border-box; font-family: var(--font-doc); font-size: calc(var(--k) * 10.5px); line-height: 1.2; }
.fpage__body { position: relative; z-index: 1; }
.fpara { position: relative; margin: 0; overflow-wrap: anywhere; }
.fpara__num { position: absolute; left: calc(var(--k) * -12px); top: 0; color: inherit; }
.fpara__fix { display: inline-block; color: #6e6e73; -webkit-user-select: none; user-select: none; }
.fdoc-band { position: absolute; z-index: 1; }
.ffloat { position: absolute; z-index: 2; box-sizing: border-box; overflow: visible; }
.ffloat.is-behind { z-index: 0; }
.ffloat--inline { position: relative; display: inline-block; vertical-align: bottom; }
.ffloat.is-image img { display: block; width: 100%; height: 100%; object-fit: fill; }
.ffloat__missing { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 24px; background: #f5f5f7; color: #6e6e73; font-size: 0.75rem; }
.ftable { border-collapse: collapse; table-layout: fixed; margin: 0; }
.ftable.is-center { margin-left: auto; margin-right: auto; }
.ftable.is-right { margin-left: auto; }
.ftable td { padding: 0 calc(var(--k) * 5.4px); vertical-align: top; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .form-badge { display: none; }
  .form-zoom { display: none; }
  .fstage { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { .fslot { transition: none; } }

/* ------------------------------------------------------------------ 웹 주소(하이퍼링크) */
::highlight(whrick-link) { color: #7b2fbe; text-decoration: underline; text-decoration-color: rgba(123, 47, 190, 0.5); }
@media (prefers-color-scheme: dark) { ::highlight(whrick-link) { color: #c69cff; text-decoration-color: rgba(198, 156, 255, 0.55); } }
.page.on-link { cursor: pointer; }

/* ------------------------------------------------------------------ profile pictures */
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--pc, #8d8d93); color: #fff; font-family: var(--font-text); font-weight: 600; line-height: 1; vertical-align: middle; user-select: none; }
.avatar--plain { background: #8d8d93; }
.avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.avatar--xs { width: 20px; height: 20px; font-size: 0.6875rem; }
.avatar--sm { width: 28px; height: 28px; font-size: 0.8125rem; }
.avatar--md { width: 40px; height: 40px; font-size: 1rem; }
.avatar--lg { width: 96px; height: 96px; font-size: 2.4rem; }
.face.avatar { margin-left: -5px; border: 2px solid var(--surface); box-sizing: content-box; }
.face.avatar:first-child { margin-left: 0; }
.global-nav__links .who--me { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.who-line { display: inline-flex; align-items: center; gap: 5px; }
.doc-card__share { display: flex; align-items: center; gap: 5px; }
.account-pic-row { display: flex; align-items: center; gap: 18px; }
.account-pic-row p { margin-top: 0; }
@media (max-width: 480px) { .account-pic-row { flex-direction: column; align-items: flex-start; } }
.code-released { margin: 0 0 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg-alt); color: var(--text-2); font-size: 0.8125rem; line-height: 1.45; }
/* the style menu already lists every style: the quick style chips step aside on narrower screens */
@media (max-width: 1439px) { .toolbar > .chip[data-set-style] { display: none; } }
/* RGB dial: three rings (R, G, B) around the color square, #RRGGBB below */
.dial { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 2px 6px; }
.dial__svg { display: block; width: 216px; height: 194px; touch-action: none; user-select: none; cursor: grab; }
.dial__svg:active { cursor: grabbing; }
.dial__track { stroke: var(--hover); }
.dial__knob { fill: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)); }
.dial__ring { outline: none; }
.dial__ring:focus-visible .dial__knob { stroke-width: 5; }
.dial__ring:focus-visible .dial__track { stroke: color-mix(in srgb, var(--primary) 22%, var(--hover)); }
.dial__square { stroke: var(--line-strong); stroke-width: 1; }
.dial__row { display: flex; align-items: center; gap: 6px; }
.dial__hex { width: 7.2em; font: 600 0.9375rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.04em; text-transform: uppercase; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); text-align: center; }
.dial__hex:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.dial__hex.is-bad { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.popover .dial__apply, .dial__apply { width: auto; min-height: 32px; justify-content: center; color: #fff; background: var(--primary); border-radius: var(--r-pill); padding: 5px 14px; }
.popover .dial__apply:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.dial__nums { display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dial__nums b { font-weight: 700; color: var(--text-2); }
.dial__target { margin: 2px 0 4px; }
.dial__more { display: flex; justify-content: space-between; gap: 8px; padding: 0 4px 2px; }
.popover .dial__more .link-btn { width: auto; min-height: 28px; padding: 2px 6px; color: var(--accent-text); }
.box-color { display: inline-flex; align-items: center; justify-content: center; }
.box-color__dot { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); background: conic-gradient(#ff3b30, #ffcc00, #34c759, #0a84ff, #af52de, #ff3b30); }
.box-color.is-on .box-color__dot { border-width: 2px; }
/* pictures: crop, flips, stretch, handles */
.pic-frame { position: relative; overflow: hidden; border-radius: var(--r-sm); background: var(--bg-alt); touch-action: none; }
.obj-figure .pic-frame img { border-radius: 0; background: none; }
.pic-frame.is-placed .pic-flip { position: absolute; inset: 0; }
.pic-frame.is-placed img { position: absolute; max-width: none; }
.pic-handle { position: absolute; z-index: 2; width: 14px; height: 14px; border-radius: 4px; background: #fff; border: 2px solid var(--primary); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 120ms ease; }
.pic-handle--se { right: 4px; bottom: 4px; cursor: nwse-resize; }
.pic-handle--e { right: 4px; top: 50%; margin-top: -10px; width: 10px; height: 20px; cursor: ew-resize; }
.pic-handle--s { bottom: 4px; left: 50%; margin-left: -10px; width: 20px; height: 10px; cursor: ns-resize; }
.obj-image:hover .pic-handle, .obj-image.is-selected .pic-handle, .obj-image:focus-within .pic-handle, .obj-image.is-resizing .pic-handle { opacity: 1; }
.obj-image.is-cropping .pic-handle { display: none; }
.pic-crop { display: none; position: absolute; z-index: 3; outline: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 0 9999px rgba(0, 0, 0, 0.5); cursor: move; touch-action: none; }
.obj-image.is-cropping .pic-crop { display: block; }
.pic-crop__h { position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.pic-crop__h--nw { left: -8px; top: -8px; cursor: nwse-resize; } .pic-crop__h--se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.pic-crop__h--ne { right: -8px; top: -8px; cursor: nesw-resize; } .pic-crop__h--sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.pic-crop__h--n { left: 50%; top: -5px; margin-left: -12px; width: 24px; height: 10px; cursor: ns-resize; } .pic-crop__h--s { left: 50%; bottom: -5px; margin-left: -12px; width: 24px; height: 10px; cursor: ns-resize; }
.pic-crop__h--w { top: 50%; left: -5px; margin-top: -12px; width: 10px; height: 24px; cursor: ew-resize; } .pic-crop__h--e { top: 50%; right: -5px; margin-top: -12px; width: 10px; height: 24px; cursor: ew-resize; }
.obj-tools.pic-tools { top: calc(100% + 8px); bottom: auto; right: auto; left: 50%; transform: translateX(-50%); z-index: 4; white-space: nowrap; }
.pic-tools .obj-tool { width: 32px; height: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.pic-tools .pic-ratio { width: auto; padding: 0 8px; font: 600 0.75rem var(--font-text); }
.pic-info { font-size: 0.75rem; color: var(--text-3); padding: 0 6px; font-variant-numeric: tabular-nums; }
.obj-image.is-cropping .pic-tools { opacity: 1; pointer-events: auto; }
.pic-cropbar { display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 5; align-items: center; gap: 6px; white-space: nowrap; padding: 4px 4px 4px 12px; background: var(--material-strong); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--shadow-float); }
.pic-cropbar__hint { font-size: 0.75rem; color: var(--text-3); }
.obj-image.is-cropping .pic-cropbar { display: flex; }
.obj-image.is-cropping .pic-tools { top: calc(100% + 56px); }
.obj-image.is-cropping .obj-figure { margin-bottom: 100px; }
.pic-tools::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
@media (max-width: 640px) { .obj-tools.pic-tools { transform: none; flex-wrap: wrap; justify-content: center; white-space: normal; max-width: 100%; } .pic-cropbar { position: static; transform: none; flex-wrap: wrap; justify-content: center; white-space: normal; margin: 8px auto 0; width: max-content; max-width: 100%; } .obj-image.is-cropping .obj-figure { margin-bottom: 0; } }
/* collaborator status: editing / online / away (yellow) / offline (gray) */
.presence { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; padding: 2px 8px 2px 6px; border-radius: var(--r-pill); }
.presence__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.presence--editing { color: #0a6c3a; background: color-mix(in srgb, #34c759 16%, transparent); }
.presence--editing .presence__dot { background: #34c759; box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6); animation: presence-pulse 1.6s ease-out infinite; }
.presence--online { color: #0b5cad; background: color-mix(in srgb, #0a84ff 12%, transparent); }
.presence--online .presence__dot { background: #0a84ff; }
.presence--away { color: #8a5a00; background: color-mix(in srgb, #ffcc00 26%, transparent); }
.presence--away .presence__dot { background: #ffcc00; }
.presence--offline { color: var(--text-3); background: color-mix(in srgb, #8e8e93 14%, transparent); }
.presence--offline .presence__dot { background: #aeaeb2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .presence--editing { color: #6ee59a; }
  :root:not([data-theme="light"]) .presence--online { color: #79b8ff; }
  :root:not([data-theme="light"]) .presence--away { color: #ffd60a; }
}
:root[data-theme="dark"] .presence--editing { color: #6ee59a; }
:root[data-theme="dark"] .presence--online { color: #79b8ff; }
:root[data-theme="dark"] .presence--away { color: #ffd60a; }
@keyframes presence-pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.55); } 70% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); } }
@media (prefers-reduced-motion: reduce) { .presence--editing .presence__dot { animation: none; } }
.presence-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.person .person__actions .presence { margin-right: 2px; }
.face.face--away { outline: 2px solid #ffcc00; outline-offset: 1px; }
.face.face--editing { outline: 2px solid #34c759; outline-offset: 1px; }
.partner-invite .people { margin-top: 8px; }
/* partner card on the account page */
.partner-card .person__name { display: flex; align-items: baseline; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.partner-list { margin-bottom: 8px; }
.partner-suggest { margin-top: 14px; }
/* invites from partners */
.nav-invites { display: inline-flex; align-items: center; gap: 6px; }
.nav-invites__n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger, #ff3b30); color: #fff; font-size: 0.6875rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.invite-stack { position: fixed; top: calc(60px + var(--safe-t, 0px)); right: 16px; z-index: 75; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.invite-card { pointer-events: auto; background: var(--material-strong, var(--surface)); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); border-radius: var(--r-md, 14px); box-shadow: var(--shadow-float); padding: 14px; animation: invite-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.invite-card__head { display: flex; gap: 10px; align-items: flex-start; }
.invite-card__text { margin: 0; font-size: 0.875rem; line-height: 1.45; color: var(--text); }
.invite-card .muted { margin: 6px 0 10px; }
.invite-card__actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
@keyframes invite-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .invite-card { animation: none; } }
@media (max-width: 640px) { .invite-stack { left: 16px; right: 16px; width: auto; } }
