:root {
    color-scheme: light;
    --ink: #1e2541;
    --muted: #5b6681;
    --edge: #e0e6f1;
    --accent: #5041d2;
    --accent-strong: #3d30b0;
    --accent-light: #eeebff;
    --surface: #ffffff;
    --page: #f5f7fc;
    --positive: #176d51;
    --positive-light: #e2f5ec;
    --caution: #8a4f16;
    --caution-light: #fff0dc;
    --danger: #9f3342;
    --danger-light: #fcebef;
    --radius: 14px;
    --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body { min-width: 280px; min-height: 100vh; margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.65; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.4; }
h1 { font-size: clamp(25px, 3vw, 34px); letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 18px; letter-spacing: -.02em; }
h3 { font-size: 15px; }
small, .small { font-size: 13px; }
strong { font-weight: 700; }
:focus-visible { outline: 3px solid #8877ef; outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 20; top: 0; left: 16px; transform: translateY(-120%); background: var(--surface); border-radius: 0 0 8px 8px; padding: 10px 16px; }
.skip-link:focus { transform: none; }
.muted { color: var(--muted); }
.break { overflow-wrap: anywhere; word-break: break-word; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.no-wrap { white-space: nowrap; }
.asset-icon { flex: none; width: 40px; height: 40px; border-radius: 11px; }
.brand { color: var(--ink); display: inline-flex; gap: 11px; align-items: center; line-height: 1.3; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-name { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.035em; }
.brand-section { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.app-header { min-height: 74px; background: var(--surface); border-bottom: 1px solid var(--edge); }
.app-header-inner { width: min(calc(100% - 64px), 1376px); min-height: 74px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.run-state { display: inline-flex; align-items: center; gap: 7px; border-radius: 30px; background: var(--positive-light); color: var(--positive); padding: 5px 11px; white-space: nowrap; font-size: 12px; font-weight: 700; }
.run-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.run-state.is-paused { background: var(--caution-light); color: var(--caution); }
.app-layout { display: grid; grid-template-columns: 202px minmax(0, 1fr); gap: 32px; width: min(calc(100% - 64px), 1376px); margin: 0 auto; }
.sidebar { padding: 28px 0; }
.nav-heading { margin: 0 0 8px 11px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.app-nav { display: grid; gap: 4px; }
.app-nav a { display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 8px 11px; color: var(--muted); border-radius: 9px; font-size: 14px; font-weight: 660; white-space: nowrap; }
.app-nav a:hover { background: #eef1fa; color: var(--ink); text-decoration: none; }
.app-nav a[aria-current="page"] { background: var(--accent-light); color: var(--accent-strong); font-weight: 800; }
.nav-symbol { display: grid; place-items: center; width: 23px; height: 23px; flex: none; font-family: var(--font); font-size: 18px; line-height: 1; font-weight: 500; }
.sidebar-meta { margin: 22px 10px 0; padding-top: 16px; border-top: 1px solid var(--edge); color: var(--muted); font-size: 12px; }
.sidebar-meta time { display: block; color: var(--ink); font-variant-numeric: tabular-nums; }
.main-content { padding: 34px 0 52px; min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 24px; }
.page-heading p { margin-top: 7px; color: var(--muted); font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); min-width: 0; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--edge); }
.card-body { padding: 18px 20px; }
.card-head p { color: var(--muted); font-size: 13px; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 0 0 18px; }
.summary-card { padding: 13px 16px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.summary .summary-card { margin: 0; }
.summary-name { color: var(--muted); font-size: 12px; font-weight: 700; }
.summary-count { color: var(--ink); font-size: 25px; font-variant-numeric: tabular-nums; font-weight: 780; letter-spacing: -.03em; line-height: 1.35; }
.section-space { margin-top: 18px; }
button, .button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; color: var(--ink); background: var(--surface); border: 1px solid #cdd6e9; border-radius: 8px; font-size: 14px; font-weight: 700; line-height: 1.4; text-align: center; transition: background .14s ease, border-color .14s ease; }
button:hover, .button:hover { text-decoration: none; background: #f3f2fa; border-color: #c1b6f8; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: var(--accent-strong); color: white; border-color: var(--accent-strong); }
.button.x-link { color: #fff; background: #23273a; border-color: #23273a; }
.button.x-link:hover { background: #373c55; border-color: #373c55; }
.subtle { color: var(--muted); background: none; border-color: var(--edge); }
.danger { color: var(--danger); }
.inline-form { display: inline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions > .small { flex-basis: 100%; }
.compact { min-height: 38px; padding: 7px 10px; font-size: 13px; }
.tab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter { display: inline-flex; min-height: 38px; align-items: center; padding: 5px 11px; border-radius: 7px; border: 1px solid transparent; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.filter:hover { background: #f3f2fa; text-decoration: none; }
.filter[aria-current="true"] { background: var(--accent-light); color: var(--accent-strong); border-color: #e3ddff; }
.pill { display: inline-flex; align-items: center; border-radius: 30px; padding: 3px 9px; background: #edf0f7; color: #485372; white-space: nowrap; font-size: 12px; font-weight: 700; line-height: 1.6; }
.pill.success { background: var(--positive-light); color: var(--positive); }
.pill.pending { background: var(--caution-light); color: var(--caution); }
.pill.scheduled { background: var(--accent-light); color: var(--accent-strong); }
.pill.error { background: var(--danger-light); color: var(--danger); }
.row-list { display: grid; }
.list-row { min-width: 0; display: grid; grid-template-columns: minmax(165px, 1.2fr) minmax(170px, 1fr) auto; gap: 16px; align-items: center; padding: 14px 20px; }
.list-row + .list-row { border-top: 1px solid var(--edge); }
.list-row .muted { display: block; margin-top: 3px; }
.list-row .actions { justify-content: flex-end; }
.list-title { font-size: 15px; font-weight: 760; overflow-wrap: anywhere; }
.list-heading { display: grid; grid-template-columns: minmax(165px, 1.2fr) minmax(170px, 1fr) auto; gap: 16px; border-bottom: 1px solid var(--edge); padding: 8px 20px; background: #f9faff; color: var(--muted); font-size: 12px; font-weight: 700; }
.list-heading span:last-child { min-width: 110px; text-align: right; }
.editor { display: grid; gap: 14px; }
.editor > .notice { margin: 0; }
.select-line { display: grid; gap: 4px; }
.select-line:not(:last-child) { margin-bottom: 8px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 750; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]), select, textarea { display: block; width: 100%; min-height: 44px; padding: 8px 10px; color: var(--ink); border: 1px solid #cdd6e9; border-radius: 8px; background: white; font-size: 16px; }
input[type="datetime-local"] { min-width: 0; }
input[readonly] { background: #f8faff !important; }
input::placeholder, textarea::placeholder { color: #717b94; }
textarea { resize: vertical; min-height: 112px; }
.field-hint { color: var(--muted); font-size: 12px; }
.choice-form { margin-top: 9px; }
.choice-form summary { color: var(--accent-strong); font-size: 13px; font-weight: 700; }
.choice-form .actions { margin-top: 6px; justify-content: flex-start; }
.draft-panel { min-width: 0; }
.draft-panel > summary { min-height: 70px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 16px; padding: 13px 20px; list-style: none; }
.draft-panel > summary::-webkit-details-marker { display: none; }
.draft-panel > summary::after { content: "+"; color: var(--accent-strong); font-size: 20px; line-height: 1; }
.draft-panel[open] > summary::after { content: "−"; }
.draft-panel > summary .draft-label { min-width: 0; }
.draft-panel[open] > summary { border-bottom: 1px solid var(--edge); }
.draft-panel + .draft-panel { margin-top: 9px; }
.draft-label strong { display: block; overflow-wrap: anywhere; }
.draft-label small { display: block; margin-top: 2px; color: var(--muted); }
.draft-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.empty { padding: 28px 20px; color: var(--muted); }
.empty strong { display: block; margin-bottom: 3px; color: var(--ink); }
.notice { margin-bottom: 16px; padding: 11px 14px; background: var(--positive-light); color: var(--positive); border: 1px solid #cce8dc; border-radius: 9px; overflow-wrap: anywhere; }
.notice.is-error { background: var(--danger-light); color: var(--danger); border-color: #f2cfd8; }
.notice.is-info { background: #eeefff; color: var(--accent-strong); border-color: #e3ddff; }
.log-row { display: grid; grid-template-columns: minmax(135px, max-content) minmax(0,1fr); gap: 8px 13px; padding: 10px 20px; font-size: 13px; overflow-wrap: anywhere; }
.log-row + .log-row { border-top: 1px solid var(--edge); }
.log-row time { color: var(--muted); white-space: nowrap; }
.log-level { margin-right: 5px; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 25px; background: radial-gradient(ellipse at top, #eeebff 0%, var(--page) 54%); }
.login-panel { width: min(100%, 430px); padding: 30px; box-shadow: 0 16px 60px rgba(49, 49, 95, .08); }
.login-panel .brand { margin-bottom: 20px; }
.login-panel h1 { font-size: 27px; }
.login-panel .field, .login-panel .primary, .login-panel .notice { margin-top: 15px; }
.login-panel .primary { width: 100%; }
@media (max-width: 1000px) {
    .app-layout { grid-template-columns: 170px minmax(0,1fr); gap: 22px; }
    .app-layout, .app-header-inner { width: calc(100% - 44px); }
}
@media (max-width: 760px) {
    .app-layout { display: block; width: calc(100% - 30px); }
    .app-header, .app-header-inner { min-height: 64px; }
    .app-header-inner { width: calc(100% - 30px); gap: 12px; }
    .header-actions { gap: 8px; }
    .sidebar { padding: 12px 0 0; }
    .sidebar .nav-heading, .sidebar-meta, .nav-symbol { display: none; }
    .app-nav { display: flex; flex-wrap: wrap; gap: 4px 5px; }
    .app-nav a { min-height: 42px; padding: 7px 10px; font-size: 13px; }
    .main-content { padding-top: 22px; }
    .page-heading { display: block; margin-bottom: 18px; }
    .page-heading .actions { margin-top: 10px; }
    .list-heading { display: none; }
    .list-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px 14px; }
    .list-row .actions { grid-column: 1 / -1; justify-content: flex-start; }
    .card-head, .card-body, .draft-panel > summary { padding-left: 14px; padding-right: 14px; }
    .draft-panel > summary { grid-template-columns: minmax(0,1fr) auto; }
    .draft-panel > summary::after { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 430px) {
    .asset-icon { width: 35px; height: 35px; }
    .brand { gap: 7px; }
    .brand-name { font-size: 14px; }
    .brand-section { font-size: 10px; }
    .run-state { font-size: 11px; padding: 4px 8px; }
    .header-actions .compact { font-size: 11px; padding: 5px 7px; }
    .summary { gap: 6px; }
    .summary-card { display: block; padding: 8px 9px; }
    .summary-count { display: block; font-size: 22px; }
    .summary-name { font-size: 11px; }
    .field-grid, .log-row { grid-template-columns: 1fr; }
    .login-panel { padding: 21px; }
}
@supports (padding: env(safe-area-inset-bottom)) {
    .main-content { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
    .app-header { padding-top: env(safe-area-inset-top); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.check-line { display: flex; gap: 9px; align-items: center; font-size: 14px; min-height: 38px; }
.check-line input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.share-box { margin-top: 3px; padding: 13px 14px; border: 1px solid var(--edge); border-radius: 9px; background: #f9faff; }
.share-box textarea { background: #fff; font-size: 14px; }
.list-row > *, .draft-panel > summary > * { min-width: 0; }
a[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
@media (max-width: 760px) {
    .share-box textarea { font-size: 16px; }
}
