:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #09090b;
    background: #fafafa;
}

* { box-sizing: border-box; }
body { min-width: 320px; height: 100vh; margin: 0; overflow: hidden; background: #fafafa; }
button, input, textarea { font: inherit; }
.topbar { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 76px; padding: 0 max(24px, calc((100% - 960px) / 2)); background: #18181b; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fafafa; font-size: 18px; font-weight: 800; letter-spacing: -.03em; text-decoration: none; }
.brand i { color: #2563eb; }
.topbar-note { color: #fafafa; font-size: 14px; opacity: .72; }
.page-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; width: min(960px, calc(100% - 48px)); height: calc(100vh - 76px); margin: 0 auto; padding: 16px 0; }
.entry-panel { order: 1; padding: 6px 18px; border: 1px solid #3f3f46; border-radius: 0; background: #fafafa; }
.logs-panel { order: 2; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.section-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.section-heading h1, .section-heading h2 { margin: 0; letter-spacing: -.035em; }
.entry-panel .section-heading h1 { font-size: 15px; }
.logs-panel .section-heading h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
.section-icon { color: #2563eb; }
.entry-form { display: grid; grid-template-columns: 140px 8px minmax(0, 1fr) minmax(0, 1.8fr) auto; align-items: end; gap: 4px; }
.form-field { display: grid; gap: 2px; min-width: 0; }
.field-summary { grid-column: 3; }
.field-detail { grid-column: 4; }
.entry-form .primary-button { grid-column: 5; }
.entry-form label { display: block; min-height: 15px; color: #52525b; font-size: 12px; font-weight: 700; line-height: 15px; text-align: center; }
.entry-form input, .entry-form textarea { width: 100%; min-height: 44px; border: 1px solid #3f3f46; border-radius: 0; background: #fafafa; color: #09090b; padding: 10px 11px; transition: border-color .18s ease, box-shadow .18s ease; }
.entry-form textarea { height: 44px; resize: vertical; }
.entry-form input::placeholder, .entry-form textarea::placeholder { color: #3f3f46; opacity: .7; }
.entry-form input:focus, .entry-form textarea:focus { outline: 0; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 15px; border: 1px solid #2563eb; border-radius: 7px; background: #2563eb; color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.primary-button:hover { border-color: #1d4ed8; background: #1d4ed8; }
.primary-button:active { transform: translateY(1px); }
.primary-button:focus-visible, .brand:focus-visible, .install-success .primary-button:focus-visible { outline: 3px solid rgba(37, 99, 235, .3); outline-offset: 3px; }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 88px 16px; border: 1px dashed #3f3f46; color: #3f3f46; text-align: center; }
.empty-state p { margin: 0; }
.empty-state .fa-solid { color: #3f3f46; font-size: 26px; }
.log-list { display: grid; gap: 0; }
.log-item { display: grid; grid-template-columns: 100px fit-content(50%) minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 4px 0 4px 4px; border: 1px solid #3f3f46; background: #fafafa; }
.log-item > .log-summary, .log-item > .log-detail, .log-item > .log-actions { align-self: stretch; display: flex; align-items: center; margin-block: -4px; padding-block: 4px; border-left: 1px solid #d4d4d8; padding-left: 8px; }
.log-date { justify-self: stretch; width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; color: #18181b; font-size: 14px; font-weight: 800; white-space: nowrap; text-align: center; }
.log-date .fa-calendar { position: static; flex: 0 0 auto; margin: 0; color: #2563eb; font-size: 16px; }
.log-summary { min-width: 0; margin: 0; color: #09090b; font-size: 17px; font-weight: 800; line-height: 1.35; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.log-detail { min-width: 0; margin: 0; color: #3f3f46; line-height: 1.55; overflow-wrap: anywhere; }
.log-actions { display: flex; align-items: center; gap: 6px; }
.icon-button, .modal-close { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid #3f3f46; border-radius: 0; background: #fafafa; color: #18181b; cursor: pointer; }
.icon-button:hover, .modal-close:hover { border-color: #2563eb; color: #2563eb; }
.delete-button:hover { border-color: #dc2626; color: #dc2626; }
.modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 9, 11, .58); }
.modal-dialog { position: relative; z-index: 1; width: min(560px, 100%); padding: 24px; border: 1px solid #3f3f46; background: #fafafa; box-shadow: 0 24px 64px rgba(9, 9, 11, .3); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-header h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.modal-form { display: grid; gap: 8px; }
.modal-form label { margin-top: 8px; color: #18181b; font-size: 13px; font-weight: 800; }
.modal-form input, .modal-form textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #3f3f46; border-radius: 0; background: #fafafa; color: #09090b; }
.modal-form textarea { resize: vertical; }
.modal-form input:focus, .modal-form textarea:focus { outline: 0; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.secondary-button, .danger-button { min-height: 42px; padding: 10px 15px; border-radius: 0; font-weight: 700; cursor: pointer; }
.secondary-button { border: 1px solid #3f3f46; background: #fafafa; color: #18181b; }
.danger-button { border: 1px solid #dc2626; background: #dc2626; color: #fff; }
.modal-confirm p { margin: 0; color: #3f3f46; line-height: 1.65; }
.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: min(400px, calc(100% - 48px)); padding: 12px; border: 1px solid #18181b; border-left: 4px solid #2563eb; background: #18181b; color: #fafafa; box-shadow: 0 12px 28px rgba(9, 9, 11, .2); }
.toast-error { border-left-color: #dc2626; }
.toast > .fa-solid { color: #60a5fa; }
.toast-error > .fa-solid { color: #f87171; }
.toast-close { display: inline-grid; width: 28px; height: 28px; place-items: center; border: 0; background: transparent; color: inherit; cursor: pointer; }
.toast-close:hover, .toast-close:focus-visible { background: #3f3f46; }
.toast-close:focus-visible { outline: 2px solid #fafafa; outline-offset: 2px; }
.drawer-page { min-height: calc(100vh - 76px); padding: 48px 24px; background: #fafafa; }
.install-drawer { width: min(520px, 100%); margin: 0 auto; padding: 32px; border: 1px solid #3f3f46; border-radius: 0; background: #fafafa; }
.install-drawer .entry-form { display: grid; grid-template-columns: 1fr; gap: 14px; }
.install-drawer .entry-form label { display: block; }
.install-drawer .entry-form .primary-button { justify-self: start; margin-top: 4px; }
.install-drawer .confirm-row { display: flex; gap: 9px; color: #52525b; font-size: 14px; line-height: 1.55; }
.install-drawer .confirm-row input { width: auto; margin-top: 3px; }
.form-error { margin-bottom: 16px; padding: 11px 12px; border-left: 3px solid #dc2626; background: #fef2f2; color: #b91c1c; font-size: 14px; }
.install-success { display: grid; justify-items: center; gap: 14px; padding: 28px 8px 8px; text-align: center; }
.success-icon { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 50%; background: #eff6ff; color: #2563eb; font-size: 32px; }
.install-success strong { color: #09090b; font-size: 22px; letter-spacing: -.03em; }
.install-success p { max-width: 340px; margin: 0; color: #52525b; line-height: 1.6; }
.success-actions { display: grid; justify-items: center; gap: 12px; margin-top: 8px; }
.redirect-tip { display: inline-flex; align-items: center; gap: 6px; color: #71717a; font-size: 13px; }
@media (max-width: 760px) {
    body { height: auto; overflow: auto; }
    .topbar { width: min(100% - 32px, 1120px); min-height: 64px; }
    .topbar-note { display: none; }
    .page-shell { width: min(100% - 32px, 960px); height: auto; margin: 12px auto 32px; padding: 0; }
    .entry-panel { padding: 6px 18px; }
    .entry-form { grid-template-columns: 1fr; }
    .field-summary, .field-detail, .entry-form .primary-button { grid-column: auto; }
    .entry-form .primary-button { justify-self: stretch; }
    .logs-panel .section-heading h2 { font-size: 28px; }
    .log-item { grid-template-columns: 1fr; gap: 4px; padding: 8px 16px; }
    .log-summary, .log-detail { white-space: normal; overflow: visible; text-overflow: clip; }
    .log-actions { margin-top: 4px; }
    .modal { padding: 16px; }
    .modal-dialog { padding: 20px; }
    .drawer-page { padding: 24px 16px; }
    .install-drawer { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
