*, *::before, *::after { box-sizing: border-box; }
:root {
  font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: #242623; background: #f2f0eb;
  --ink: #242623; --muted: #65665e; --line: #dfdcd3; --paper: #fff;
  --side: #ece9e2; --side-ink: #272924; --side-muted: #62645b;
  --accent: #444d21; --accent-deep: #343b19; --soft: #e7ebd6;
  --lime: #d8ed78; --radius: 12px; --sidebar: 218px;
}
body { margin: 0; font-size: 14px; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #707b37; outline-offset: 3px; }
::selection { background: #dce9a0; color: #25291d; }
.boot { padding: 40px; color: var(--muted); }
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  color: var(--side-ink); padding: 17px 13px 13px; background: var(--side); border-right: 1px solid var(--line); z-index: 6;
}
.brand { display: flex; align-items: center; gap: 10px; margin: 0 8px 28px; color: #f2fcf9; font-size: 15px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.brand-mark { display: flex; gap: 3px; align-items: flex-end; justify-content: center; width: 31px; height: 31px; padding-bottom: 7px; border-radius: 8px; background: #d8ed78; }
.brand-mark i { width: 3px; border-radius: 2px 2px 1px 1px; background: #242623; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 17px; }
.project-switch { position: relative; margin: 0 1px 16px; }
.project-switch summary, .switch-options a {
  display: flex; list-style: none; align-items: center; gap: 10px; min-height: 49px; padding: 7px 9px;
  border: 1px solid #dcd8ce; border-radius: 9px; background: #e3dfd6; color: #242623;
}
.project-switch summary::-webkit-details-marker { display: none; }
.project-switch summary:hover, .project-switch[open] summary { background: #f5f3ed; border-color: #c9c4b6; }
.project-switch summary > svg { margin-left: auto; color: var(--side-muted); }
.project-mark { display: inline-grid; place-items: center; width: 29px; height: 29px; flex: none; border-radius: 7px; font-size: 15px; font-weight: 750; }
.project-mark.jikeda { background: #dee1d3; color: #303c29; }
.project-mark.miju { background: #e4dbc9; color: #563f24; }
.project-label { display: grid; gap: 0; }
.project-label small { font-size: 10px; color: #65665e; }
.project-label strong { font-size: 14px; }
.switch-options { position: absolute; top: calc(100% + 5px); left: 0; width: 100%; background: #e3dfd6; border: 1px solid #d9d5c8; border-radius: 9px; padding: 4px; box-shadow: 0 15px 26px #302b202e; z-index: 8; }
.switch-options a { border: 0; padding: 5px 7px; min-height: 47px; font-size: 13px; }
.switch-options a:hover { background: #ecebdc; }
.switch-options .project-mark { width: 28px; height: 28px; font-size: 12px; }
.current-check { margin-left: auto; color: #495020; }
.sidebar nav { overflow: auto; }
.nav-group + .nav-group { margin-top: 13px; }
.nav-group h2 { padding: 0 10px 7px; color: var(--side-muted); font-size: 11px; font-weight: 550; letter-spacing: .08em; }
.nav-item { display: flex; gap: 10px; align-items: center; min-height: 31px; margin: 1px 1px; padding: 6px 10px; border-radius: 7px; color: #31332c; font-size: 13px; }
.nav-item svg { color: #575b51; }
.nav-item:hover { background: #f5f2eb; color: var(--ink); }
.nav-item[aria-current="page"] { background: #e3edac; color: #222522; font-weight: 650; }
.nav-item[aria-current="page"] svg { color: #242821; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 13px 5px 3px; border-top: 1px solid #d9d5c9; }
.account { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-mark { display: grid; width: 29px; height: 29px; flex: none; place-items: center; border-radius: 50%; background: #dcdacf; color: #2c2e25; font-size: 12px; font-weight: 700; }
.account div { display: grid; min-width: 0; }
.account strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.account small { color: var(--side-muted); font-size: 10px; }
.sidebar-account-actions { display: flex; flex: none; }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; color: currentColor; background: transparent; padding: 0; }
.icon-button:hover { background: #454a3315; }
.sidebar .icon-button:hover { background: #e0decf; }
.shade, .menu-toggle { display: none; }
.workspace { min-width: 0; }
.topbar { min-height: 61px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 clamp(19px, 3vw, 42px); border-bottom: 1px solid var(--line); background: var(--paper); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs strong { color: var(--ink); font-weight: 650; }
.slash { color: #9ba9ac; }
.header-date, .preview-label { color: #63645b; font-size: 12px; white-space: nowrap; }
.preview-label { display: inline-flex; align-items: center; gap: 7px; }
.preview-label i { width: 7px; height: 7px; background: #93691c; border-radius: 50%; }
.page { max-width: 1550px; margin: 0 auto; padding: 29px clamp(19px, 3vw, 42px) 58px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 25px; }
.page-head h1 { font-size: clamp(27px, 2.45vw, 36px); font-weight: 750; letter-spacing: -.04em; line-height: 1.22; overflow-wrap: anywhere; }
.page-head p { margin-top: 8px; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 6px #28251b07; min-width: 0; }
.detail-panel h2 { font-size: 16px; color: #252824; line-height: 1.3; font-weight: 700; }
.text-action { display: inline-flex; gap: 6px; align-items: center; color: var(--accent); font-size: 12px; font-weight: 650; }
.text-action:hover, .row-action a:hover { text-decoration: underline; text-underline-offset: 3px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 1px solid #dad7cb; border-radius: 7px; color: #35372e; background: #fff; font-size: 13px; font-weight: 650; white-space: nowrap; transition: border-color .15s ease, background .15s ease; }
.button:hover:not(:disabled) { background: #f5f3eb; border-color: #ccc8b8; }
.button.primary { border-color: #c7db75; background: var(--lime); color: #252821; }
.button.primary:hover:not(:disabled) { border-color: #b7c96a; background: #e3ee9b; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.heading-actions { justify-content: flex-end; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 15px; }
.search-form { display: flex; gap: 8px; width: min(100%, 412px); }
.search-control { display: flex; min-width: 0; flex: 1; align-items: center; gap: 7px; padding-left: 10px; border: 1px solid #dad7cb; border-radius: 7px; color: var(--muted); }
.search-control input { width: 100%; min-width: 0; padding-left: 0; border: 0; outline: none; background: transparent; }
.search-control:focus-within { outline: 2px solid #707b37; outline-offset: 1px; }
input, select, textarea { min-height: 34px; padding: 7px 9px; border: 1px solid #dad7cb; border-radius: 7px; line-height: 1.35; background: #fff; }
input::placeholder, textarea::placeholder { color: #6a6c62; }
textarea { width: 100%; resize: vertical; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.table-scroll { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
th, td { padding: 13px 15px; text-align: left; font-size: 13px; }
th { padding-block: 9px; background: #f3f1eb; color: #57594f; font-weight: 650; font-size: 11px; white-space: nowrap; }
td { border-top: 1px solid #eeebe5; color: #3b3d35; }
td.strong { color: #252923; font-weight: 670; }
td.strong a:hover, .related a:hover, .facts a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
td.clip a { display: block; max-width: min(44vw, 450px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
td.time, td.mono, td.row-action { white-space: nowrap; }
td.time, td.mono { color: #55574e; font-variant-numeric: tabular-nums; }
.record-number { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 9px; font-variant-numeric: tabular-nums; }
.record-number .quiet-button { padding: 2px 6px; min-height: 24px; font-size: 12px; }
td.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
tbody tr:hover { background: #faf9f3; }
.row-action { text-align: right; }
.row-action a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 3px 8px; border-radius: 5px; background: #edf1f2; color: #435355; font-size: 11px; font-weight: 650; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 100%; background: currentColor; }
.badge-pending, .badge-reviewing, .badge-submitted { background: #fbefd7; color: #815510; }
.badge-healthy, .badge-approved, .badge-completed, .badge-published, .badge-confirmed { background: #e4f3ea; color: #24614e; }
.badge-transit, .badge-contacting, .badge-delivered { background: #e5f0f6; color: #24587b; }
.badge-rejected, .badge-unavailable { background: #f8e7e5; color: #963f3a; }
.badge-open, .badge-draft { background: #fbefd7; color: #815510; }
.badge-working { background: #e5f0f6; color: #24587b; }
.badge-resolved { background: #e4f3ea; color: #24614e; }
.content-actions { margin-top: 16px; }
.content-versions { margin-top: 12px; }
.ticket-events li { align-items: flex-start; }
.ticket-copy { margin-top: 5px; font-size: 13px; line-height: 1.6; }
.pagination { min-height: 53px; padding: 8px 14px; display: flex; justify-content: flex-end; align-items: center; gap: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.empty { display: grid; place-items: center; align-content: center; gap: 11px; min-height: 153px; padding: 24px; color: var(--muted); text-align: center; }
.empty strong { font-weight: 600; }
.loading { padding-top: 18px; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 14px; font-weight: 650; font-size: 12px; color: #545e2f; }
.detail-grid, .rule-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; align-items: start; }
.detail-panel { padding: 17px 17px 18px; }
.detail-panel h2 { margin-bottom: 14px; }
.detail-panel :is(.muted, .events, .facts) { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.facts div { min-width: 0; padding-block: 7px; border-bottom: 1px solid #eeebe5; }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 13px; }
dd a, .related a { color: var(--accent); }
.events, .related, .rules-list { list-style: none; padding: 0; margin: 0; }
.events li, .related li { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 9px 0; overflow-wrap: anywhere; }
.events li + li, .related li + li { border-top: 1px solid #ebe9df; }
.events p { color: var(--muted); font-size: 12px; }
.events strong { font-size: 13px; font-weight: 650; }
.event-meta { display: grid; text-align: right; flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.related small { display: block; color: var(--muted); font-size: 11px; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 12px; }
.rule-heading { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.rule-heading h2 { margin-bottom: 0; }
.entry { margin: 14px 0; }
.entry .action-row { margin-top: 7px; }
.rules-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #eeebe5; }
.rule-text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.rule-result { margin-top: 12px; padding: 10px; background: #f4f4e9; color: #5b5d4d; border-radius: 6px; font-size: 12px; }
.message { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.rule-result .message { margin-top: 5px; }
.dialog { border: 1px solid #e6e1d5; border-radius: 13px; width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; color: var(--ink); box-shadow: 0 20px 64px #29261a44; }
.dialog.wide { width: min(730px, calc(100% - 22px)); }
.dialog::backdrop { background: #1b1d1765; }
.dialog-head { top: 0; z-index: 1; position: sticky; padding: 11px 16px; display: flex; align-items: center; gap: 5px; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 15px 16px; }
.form-intro { margin: 0 0 13px; font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields:empty { display: none; }
.field { display: grid; gap: 5px; min-width: 0; font-size: 12px; font-weight: 650; color: #334b46; }
.field.full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
.field .hint { font-size: 11px; color: var(--muted); font-weight: 450; }
.required { color: #8e4a2e; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.fill { flex: 1; }
.form-error, .quote { margin-top: 12px; padding: 8px 11px; border-radius: 6px; color: #923c32; background: #fceeea; font-size: 12px; }
.quote { color: #215f4e; background: #e7f5ed; }
.secure-image { display: block; max-width: 100%; max-height: 66vh; margin: 0 auto; object-fit: contain; min-width: 100px; min-height: 58px; background: #f6f8f7; }
#notice { position: fixed; bottom: 24px; right: 24px; max-width: calc(100vw - 48px); z-index: 10; }
.toast { padding: 11px 14px; border: 1px solid #bdc690; border-radius: 8px; color: #455326; background: #eff4df; box-shadow: 0 6px 18px #28261917; }
.toast.error { border-color: #e0a69d; color: #893930; background: #fff2ee; }
.login-layout { min-height: 100dvh; display: grid; grid-template-columns: clamp(240px, 33vw, 490px) minmax(0,1fr); }
.login-aside { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 34px 28px; color: #f4fbf9; background: #272a24; }
.login-aside .brand { margin: 0; }
.login-projects { display: grid; gap: 9px; padding-bottom: 6px; }
.login-projects div { display: flex; align-items: center; gap: 10px; color: #c4dfd8; font-weight: 600; }
.login-content { display: grid; align-items: center; justify-items: center; padding: 25px; }
.login-box { width: min(100%, 390px); }
.login-box h1 { font-size: 33px; font-weight: 750; }
.login-box > p { margin-top: 5px; }
.login-form { display: grid; gap: 13px; margin-top: 22px; }
.login-form input { background: white; min-height: 42px; }
.login-submit { margin-top: 5px; min-height: 41px; }
@media (max-width: 1120px) {
  .page, .topbar { padding-inline: 24px; }
}
@media (max-width: 880px) {
  :root { --sidebar: 189px; }
  .sidebar { padding-inline: 9px; }
  .detail-grid, .rule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 675px) {
  .layout { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(240px, 84vw); visibility: hidden; transform: translateX(-100%); padding-inline: 14px; }
  .nav-open .sidebar { visibility: visible; transform: none; }
  .nav-open .shade { position: fixed; display: block; z-index: 5; inset: 0; padding: 0; border: 0; background: #22251e67; }
  .menu-toggle { display: inline-grid; }
  .page, .topbar { padding-inline: 15px; }
  .page { padding-top: 22px; }
  .topbar { min-height: 51px; }
  .breadcrumbs { gap: 6px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
  .heading-actions { justify-content: flex-start; }
  .toolbar { flex-wrap: wrap; }
  th, td { padding-inline: 11px; }
  .login-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-aside { padding: 16px 20px; }
  .login-projects { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
