:root {
  color-scheme: light;
  --ink: #232a27;
  --muted: #4f5b54;
  --soft: #525e56;
  --accent: #224944;
  --accent-dark: #173a35;
  --wash: #e9eeea;
  --bg: #f6f5f0;
  --line: #e2e4dc;
  --white: #fff;
  --round: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #356e62; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; vertical-align: middle; }
.initial { padding: 3rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.layout { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { height: 100dvh; position: sticky; top: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 27px 18px 19px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.55rem; font-weight: 750; letter-spacing: -.07em; width: fit-content; }
.sidebar .brand { margin: 2px 9px 54px; }
.brand-icon { display: grid; place-items: center; background: var(--accent); color: #fff; width: 37px; height: 37px; border-radius: 11px; }
.nav-label { margin: 0 10px 11px; color: #526059; font-size: .73rem; font-weight: 750; letter-spacing: .105em; }
.nav-item { text-decoration: none; color: #414d47; min-height: 44px; display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding: 8px 12px; font-size: .94rem; font-weight: 550; border-radius: 9px; }
.nav-item:hover { background: #f2f4ef; color: var(--accent); }
.nav-item.selected { background: #e8eeea; color: var(--accent-dark); font-weight: 680; }
.sidebar-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.account { display: flex; width: 100%; text-align: left; align-items: center; gap: 10px; min-height: 54px; border: 0; border-radius: 9px; background: transparent; padding: 6px; }
.account:hover { background: var(--bg); }
.account > span:nth-child(2) { flex: 1; min-width: 0; }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account strong { font-size: .87rem; }
.account small { color: var(--soft); font-size: .78rem; margin-top: 2px; }
.account > svg { color: var(--soft); }
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #e1e9e3; color: #264d44; font-weight: 750; font-size: .83rem; border: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; gap: 16px; padding: 8px clamp(24px, 4vw, 60px); border-bottom: 1px solid var(--line); background: #fff; }
.crumb { display: flex; align-items: center; gap: 9px; color: #414e47; font-size: .9rem; font-weight: 650; margin-right: auto; white-space: nowrap; }
.crumb > svg { color: #536e62; }
.crumb .icon-button { display: none; }
.global-search, .inline-search { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: #f8f8f4; min-height: 40px; color: #526059; padding: 4px 10px; }
.global-search { width: min(298px, 42vw); }
.global-search input, .inline-search input { width: 100%; min-width: 0; border: 0; background: transparent; font-size: .88rem; outline: none; padding: 4px 0; }
.global-search:focus-within, .inline-search:focus-within { border-color: #72968a; }
.global-search input:focus-visible, .inline-search input:focus-visible { outline: 0; }
.global-search kbd { white-space: nowrap; font-family: inherit; font-size: .69rem; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 2px 4px; }
.main { max-width: 1440px; margin: 0 auto; padding: 37px clamp(24px, 4vw, 60px) 72px; }
.page-intro, .detail-intro { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
h1 { font-size: clamp(2.05rem, 3.05vw, 3.1rem); letter-spacing: -.06em; line-height: 1.08; font-weight: 760; overflow-wrap: anywhere; }
.page-intro p, .detail-intro p { color: var(--muted); margin-top: 10px; line-height: 1.5; }
.button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; text-decoration: none; font-weight: 670; font-size: .88rem; min-height: 41px; padding: 8px 13px; border: 1px solid #d9ded5; border-radius: 9px; background: #fff; white-space: nowrap; }
.button:hover, .icon-button:hover { background: #edf2ed; border-color: #c8d7cd; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 3px 8px #173a3516; }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.subtle, .text-button { background: transparent; border-color: transparent; color: var(--accent-dark); }
.button.subtle:hover, .text-button:hover { background: var(--wash); }
.button.danger { color: #9e2c47; background: #fff3f5; border-color: #f0d8df; }
.icon-button { padding: 0; width: 39px; min-height: 38px; border-color: transparent; background: transparent; color: #526059; }
.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.centered { justify-content: center; }
.feature { color: #fbfaf5; min-height: 229px; display: grid; grid-template-columns: 1.18fr 1fr; position: relative; overflow: hidden; align-items: center; padding: 26px 32px; border-radius: 18px; border: 1px solid #224944; background: #224944; margin-bottom: 33px; }
.feature .button.primary { background: #f6f5f0; border-color: #f6f5f0; color: var(--accent-dark); box-shadow: none; }
.feature .button.primary:hover { background: #e1e9e3; border-color: #e1e9e3; }
.feature .button:focus-visible { outline-color: #f6f5f0; }
.feature-content { min-width: 0; }
.feature-label { display: inline-flex; align-items: center; gap: 7px; color: #cadbd0; font-weight: 760; letter-spacing: .105em; font-size: .71rem; }
.feature h2 { font-size: clamp(1.65rem, 2.7vw, 2.75rem); line-height: 1.08; max-width: 570px; margin-top: 11px; font-weight: 740; letter-spacing: -.055em; overflow-wrap: anywhere; }
.feature p { color: #e1e8df; margin: 8px 0 18px; font-size: .92rem; }
.feature p span { margin: 0 3px; }
.feature-visual { min-width: 0; padding: 8px 10px 0 27px; }
.wave { display: flex; gap: 4px; align-items: center; height: 97px; }
.wave i { height: var(--bar); flex: 1; max-width: 6px; background: #a7c1b3; border-radius: 999px; opacity: .75; }
.wave i:nth-child(4n+1) { opacity: .43; }
.wave i:nth-child(7n+1) { background: #edf4ec; }
.wave-line { height: 3px; background: #698e80; border-radius: 9px; margin-top: 9px; }
.wave-line i { display: block; height: 100%; border-radius: 9px; background: #f6f5f0; }
.wave-caption { display: flex; justify-content: space-between; padding-top: 8px; color: #d0e0d5; font-size: .71rem; font-weight: 720; letter-spacing: .07em; }
.section-heading, .section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading { justify-content: space-between; margin-bottom: 13px; }
h2 { font-size: 1.3rem; letter-spacing: -.035em; }
.count { color: #354d42; font-size: .76rem; font-weight: 700; padding: 3px 8px; background: #e9ede5; border-radius: 999px; }
.select-shell { min-width: 127px; position: relative; }
.select-shell select { width: 100%; appearance: none; padding: 7px 25px 7px 9px; background: #fff; border: 1px solid var(--line); border-radius: 7px; color: #4f5b54; font-size: .83rem; }
.select-shell svg { position: absolute; right: 7px; top: 9px; pointer-events: none; color: #526059; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 17px; }
.filters button { display: inline-flex; align-items: center; gap: 6px; min-height: 35px; background: #fff; border: 1px solid var(--line); color: #526059; padding: 5px 12px; border-radius: 8px; font-size: .86rem; font-weight: 625; }
.filters button:hover, .filters button.active { background: #e9eeea; color: var(--accent-dark); border-color: #d7e1d9; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.material-card { display: flex; flex-direction: column; min-width: 0; position: relative; padding: 16px; border: 1px solid var(--line); background: #fff; border-radius: 13px; min-height: 191px; box-shadow: 0 2px 4px #24392e06; transition: border-color .15s, box-shadow .15s; }
.material-card:hover, .material-card:focus-within { border-color: #b3c6bb; box-shadow: 0 4px 13px #24392e0a; }
.card-top, .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-top { margin-bottom: 11px; }
.type-icon { display: grid; place-items: center; flex: none; width: 43px; height: 43px; border-radius: 11px; color: #28554a; background: var(--wash); }
.type-icon.video { color: #415c68; background: #e9eff0; }
.type-icon.link { color: #7a4d35; background: #f2e8dc; }
.kind-pill { border-radius: 999px; background: #f2f3ee; padding: 4px 8px; color: #4f5b54; font-size: .75rem; font-weight: 650; }
.material-card h3 { font-size: 1.02rem; letter-spacing: -.025em; line-height: 1.32; overflow-wrap: anywhere; }
.card-link { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; }
.card-author { color: var(--muted); font-size: .87rem; line-height: 1.4; margin: 3px 0 8px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 9px; }
.tags span { color: #41594c; background: #edf0e9; padding: 3px 8px; border-radius: 6px; font-size: .77rem; font-weight: 640; overflow-wrap: anywhere; }
.card-footer { border-top: 1px solid #ebede6; padding-top: 8px; margin-top: auto; min-height: 31px; }
.status, .card-meta { display: inline-flex; align-items: center; gap: 5px; color: #526059; font-size: .75rem; }
.status.ready { color: #265b48; }
.status.processing { color: #465e79; }
.status.failed { color: #a03f50; }
.card-meta { white-space: nowrap; }
.group-card { min-height: 132px; }
.group-card h3 { margin-top: 10px; }
.group-filters { margin-bottom: 23px; }
.empty { display: grid; place-items: center; text-align: center; min-height: 211px; align-content: center; border: 1px dashed #d5dcd3; border-radius: 13px; padding: 23px 18px; margin-top: 6px; background: #fafaf6; }
.empty-icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 10px; color: var(--accent); background: #e9eeea; border-radius: 12px; }
.empty h3 { font-size: 1.08rem; margin-bottom: 6px; }
.empty p { color: var(--muted); line-height: 1.5; max-width: 490px; }
.empty .button, .empty .actions { margin-top: 13px; }
.back-link, .source-link { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--accent-dark); font-size: .87rem; font-weight: 680; }
.back-link { margin-bottom: 21px; }
.source-link { margin: 13px 0 19px; }
.back-link:hover, .source-link:hover { text-decoration: underline; }
.detail-intro { align-items: flex-end; margin-bottom: 23px; }
.detail-intro h1 { font-size: clamp(1.95rem, 3.4vw, 3.3rem); }
.detail-intro .actions { flex: none; }
.detail-utilities { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.player { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-bottom: 17px; }
.player-title { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.player-title div { flex: 1; min-width: 0; }
.player-title strong, .player-title small { display: block; overflow-wrap: anywhere; }
.player-title small { color: var(--muted); margin-top: 3px; }
.player audio { width: 100%; display: block; }
.player video, .video-frame { width: 100%; max-height: 450px; background: #25312c; display: block; border: 0; border-radius: 9px; }
.video-frame { aspect-ratio: 16 / 9; max-width: 800px; }
.upload-placeholder { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.upload-placeholder p { flex: 1; }
.study-surface { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 17px; min-width: 0; }
.study-tabs { border-bottom: 1px solid var(--line); display: flex; gap: 17px; margin: -17px -17px 0; padding: 0 16px; overflow-x: auto; }
.study-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); min-height: 50px; padding: 0 7px; font-size: .9rem; font-weight: 670; white-space: nowrap; }
.study-tabs button:hover, .study-tabs button.active { color: var(--accent-dark); }
.study-tabs .active { border-bottom-color: var(--accent); }
.study-tabs span { font-size: .75rem; }
.study-panel { padding-top: 14px; }
.study-tools { display: flex; align-items: center; gap: 9px; justify-content: space-between; margin-bottom: 8px; }
.study-tools .inline-search { width: min(100%, 330px); }
.segment { display: grid; grid-template-columns: 63px minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 15px 4px; border-bottom: 1px solid #ebede6; scroll-margin-top: 15px; }
.segment:last-child, .record:last-child { border-bottom: 0; }
.segment p { line-height: 1.67; font-size: 1.03rem; overflow-wrap: anywhere; }
.segment.highlight { background: #eef3ed; border-radius: 8px; }
.timestamp { min-width: 53px; max-width: 100%; width: fit-content; padding: 5px 6px; border-radius: 7px; border: 0; font-variant-numeric: tabular-nums; color: var(--accent-dark); background: var(--wash); font-size: .8rem; font-weight: 700; }
.timestamp.plain { background: transparent; color: var(--muted); text-align: center; }
.notice { margin: 8px 0; padding: 9px 12px; background: #edf2ed; color: #354d42; border-radius: 7px; }
.record { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 15px 4px; border-bottom: 1px solid #ebede6; }
.record > div:first-child { min-width: 0; }
.record p { margin: 5px 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.record small { display: block; margin-top: 3px; color: var(--muted); }
.record-type { display: inline-flex; background: var(--wash); color: var(--accent-dark); border-radius: 6px; padding: 3px 7px; font-size: .76rem; font-weight: 650; }
.text-button { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 4px 7px; }
.summary { padding-left: 23px; line-height: 1.6; }
.summary li + li { margin-top: 6px; }
.ai-layout { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 2.8fr); gap: 14px; align-items: start; }
.ai-scope h2 { margin-bottom: 12px; }
.ai-scope p { color: var(--muted); line-height: 1.5; }
.scope-item { display: flex; align-items: center; gap: 8px; padding: 8px 2px; cursor: pointer; overflow-wrap: anywhere; }
.scope-item input, .check-field input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.chat-header { display: flex; flex-wrap: wrap; gap: 5px 12px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.chat-header span { font-size: .8rem; color: var(--muted); }
.chat-messages { min-height: 230px; max-height: 55vh; overflow: auto; }
.message { background: #f1f3ee; border-radius: 8px; margin: 8px 14px 8px 0; padding: 10px 12px; }
.message.user { margin: 8px 0 8px 14px; background: #e7eee9; }
.message strong { font-size: .8rem; color: #385349; }
.message p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; line-height: 1.56; }
.chat-footer { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.chat-footer form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.chat-footer textarea { width: 100%; }
.shared-header { background: white; padding: 14px max(22px, calc((100% - 920px) / 2)); display: flex; gap: 15px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.shared-header > span { color: var(--muted); font-size: .86rem; }
.shared-main { max-width: 1000px; }
dialog { width: min(92vw, 478px); max-height: 88dvh; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); padding: 19px; box-shadow: 0 18px 65px #20382e38; }
dialog.wide { width: min(92vw, 655px); }
dialog::backdrop { background: #1d2b2560; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-bottom: 12px; }
.dialog-header h2 { font-size: 1.39rem; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.dialog-copy { color: var(--muted); line-height: 1.56; overflow-wrap: anywhere; }
.google-form { margin-top: 10px; }
.google-button { width: 100%; border-color: #747775; color: #1f1f1f; }
.google-button:hover { background: #f4f7fb; border-color: #747775; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form { display: grid; gap: 13px; }
.form label { display: grid; gap: 5px; font-size: .9rem; font-weight: 650; min-width: 0; }
.form label small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.form label.check-field { display: flex; align-items: center; gap: 7px; }
.form input:not([type=checkbox]), .form select, .form textarea, .chat-footer textarea { min-width: 0; border: 1px solid #d8ded4; border-radius: 8px; background: #fcfcf9; padding: 9px 10px; min-height: 41px; outline-offset: 1px; font-weight: 450; }
.form select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill='none' stroke='%23526059' stroke-width='1.6' d='m5 7 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 18px; padding-right: 30px; }
.form textarea, .chat-footer textarea { resize: vertical; line-height: 1.5; }
.form input[type=file] { max-width: 100%; font-size: .86rem; }
.form input[type=file]::file-selector-button { border: 0; background: var(--wash); color: var(--accent-dark); padding: 5px 7px; border-radius: 4px; margin-right: 6px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.form-error { border-radius: 7px; background: #fff1f3; color: #8b2d43; font-size: .89rem; padding: 7px 10px; }
.type-picker { display: flex; gap: 7px; }
.type-picker button { flex: 1; }
.type-picker .chosen { border-color: #c9dacd; color: var(--accent-dark); background: var(--wash); }
.form blockquote { border-left: 3px solid #b8cbbc; margin: 0; padding: 8px 12px; background: #f3f5ef; line-height: 1.5; }
.export-options { display: grid; gap: 5px; }
progress { width: 100%; accent-color: var(--accent); }
.toast { position: fixed; z-index: 10; right: 18px; bottom: 18px; max-width: min(92vw, 420px); background: #263b33; color: #fff; border-radius: 9px; padding: 10px 14px; box-shadow: 0 4px 20px #1d2b2535; }
.print-doc { display: none; }
@media (max-width: 1080px) {
  .layout { grid-template-columns: 209px minmax(0, 1fr); }
  .main, .topbar { padding-left: 25px; padding-right: 25px; }
  .feature { padding: 22px; }
  .feature-visual { padding-right: 0; padding-left: 17px; }
  .cards { gap: 10px; }
  .material-card { padding: 12px; }
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 174px minmax(0, 1fr); }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .detail-intro { flex-wrap: wrap; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 670px) {
  .layout { display: block; }
  .sidebar { display: none; border-right: 0; }
  .sidebar.nav-open { display: flex; position: absolute; z-index: 5; top: 58px; width: min(247px, 78vw); height: min(420px, calc(100dvh - 58px)); padding-top: 17px; border: 1px solid var(--line); box-shadow: 0 10px 26px #20382e22; border-radius: 0 0 11px 0; }
  .sidebar .brand { margin-bottom: 23px; }
  .crumb > svg { display: none; }
  .crumb .icon-button { display: inline-flex; width: 28px; }
  .crumb { gap: 4px; }
  .topbar { min-height: 58px; padding: 7px 12px; gap: 9px; }
  .main { padding: 25px 15px 58px; }
  .global-search { width: min(45vw, 300px); }
  .global-search kbd { display: none; }
  .page-intro { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
  .page-intro p { margin-top: 6px; }
  .feature { min-height: 0; padding: 17px; margin-bottom: 24px; }
  .feature h2 { font-size: clamp(1.45rem, 5.5vw, 2.2rem); }
  .feature-visual { padding-left: 13px; }
  .wave { gap: 2px; }
  .detail-intro .actions { flex: 0 1 auto; }
  .study-tabs { gap: 6px; }
  .study-tabs button { padding: 0 5px; }
  .study-surface { padding: 11px; }
  .study-tabs { margin: -11px -11px 0; padding: 0 10px; }
  .segment { grid-template-columns: 49px minmax(0, 1fr) auto; gap: 6px; padding-left: 0; padding-right: 0; }
  .timestamp { min-width: 45px; padding-left: 3px; padding-right: 3px; }
  .ai-layout { grid-template-columns: 1fr; }
  .ai-scope { max-height: 200px; overflow-y: auto; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 410px) {
  .feature { grid-template-columns: 1fr; }
  .feature-visual { display: none; }
  .cards { grid-template-columns: 1fr; }
  .material-card { min-height: 164px; }
  .record { flex-wrap: wrap; }
  .study-tabs button { font-size: .81rem; }
  .upload-placeholder { flex-wrap: wrap; }
}
@media print {
  @page { margin: 17mm; }
  html, body { background: #fff; color: #111; }
  body.printing > :not(.print-doc) { display: none !important; }
  .print-doc { display: block; max-width: 100%; font-family: Georgia, serif; font-size: 11pt; line-height: 1.54; }
  .print-doc h1 { color: #232a27; font-size: 24pt; margin: 0 0 .5em; }
  .print-doc h2 { font-size: 16pt; margin-top: 1.3em; break-after: avoid; }
  .print-doc p { margin: .55em 0; white-space: pre-wrap; overflow-wrap: anywhere; }
}
