* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 案3で採用した配色（A案：アプリコット系）。変数名は既存コードとの互換のため維持。 */
    --bg: #fbf6f1;
    --surface: #ffffff;
    --surface-soft: #f8f0e7;
    --surface-green: #f7ece1;
    --line: #ecdfd0;
    --line-strong: #ddc9b2;
    --text: #291f16;
    --muted: #7c6c5c;
    --muted-soft: #ab9c8b;
    --green: #c9612f;
    --green-dark: #a24d24;
    --green-soft: #fbe7da;
    --yellow: #bd7f27;
    --yellow-soft: #fbf1de;
    --red: #bf4a37;
    --red-soft: #fbe6e2;
    --shadow-sm: 0 1px 2px rgba(41, 31, 22, 0.05), 0 10px 28px rgba(41, 31, 22, 0.05);
    --shadow-md: 0 14px 34px rgba(41, 31, 22, 0.1);
    --radius: 16px;
    --radius-sm: 12px;
    --focus: 0 0 0 4px rgba(201, 97, 47, 0.18);
}

html {
    background: var(--bg);
}

body {
    min-height: 100vh;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
    line-height: 1.55;
}

/* 案3: 上部ナビゲーション（PC）＋下部固定タブ（スマホ）のシェル */
[class$="-kicker"] {
    display: none;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 64px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: var(--green);
    color: #ffffff;
    font-weight: 900;
    font-size: 14px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-name {
    font-size: 14px;
    font-weight: 850;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.topbar-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 720;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
}

.nav-icon svg {
    width: 19px;
    height: 19px;
}

.nav-link:hover {
    background: var(--surface-soft);
    color: var(--green-dark);
}

.nav-link.active {
    background: var(--green-soft);
    color: var(--green-dark);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.btn-quick-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 12px;
    background: var(--green);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(162, 77, 36, 0.18);
}

.btn-quick-add:hover {
    background: var(--green-dark);
}

.app-main {
    min-width: 0;
    flex: 1;
    padding: 22px 28px 32px;
}

.header-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

/* 下部固定タブ（スマホ）*/
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: none;
    align-items: stretch;
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-height: 52px;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.bottom-nav-item .nav-icon svg {
    width: 22px;
    height: 22px;
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 750;
}

.bottom-nav-item.active {
    color: var(--green);
}

.bottom-nav-fab-wrap {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bottom-nav-fab {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 999px;
    background: var(--green);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(162, 77, 36, 0.32);
    position: relative;
    top: -14px;
}

.bottom-nav-fab svg {
    width: 24px;
    height: 24px;
}

/* 「その他」メニューシート */
.more-sheet[hidden] {
    display: none;
}

.more-sheet {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
}

.more-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(41, 31, 22, 0.32);
}

.more-sheet-panel {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    box-shadow: 0 -12px 32px rgba(41, 31, 22, 0.18);
}

.more-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.more-sheet-head button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
}

.more-sheet-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 10px;
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    font-weight: 720;
    text-decoration: none;
}

.more-sheet-link:hover {
    background: var(--surface-soft);
}

@media (max-width: 899px) {
    .topbar-nav,
    .topbar-actions .header-status {
        display: none;
    }

    .topbar-actions .btn-quick-add {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.page-kicker {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    font-weight: 760;
    line-height: 1.2;
}

.page-header p:not(.page-kicker) {
    max-width: 680px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.page-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: var(--green);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(162, 77, 36, 0.16);
    font-size: 14px;
    font-weight: 760;
    text-decoration: none;
    white-space: nowrap;
}

#page-dashboard .page-action {
    min-height: 40px;
    padding: 9px 15px;
    border-color: var(--line-strong);
    border-radius: 12px;
    background: linear-gradient(180deg, #d9773f 0%, var(--green-dark) 100%);
    box-shadow: 0 10px 22px rgba(162, 77, 36, 0.18);
    font-size: 13px;
    font-weight: 820;
}

.page-action.secondary,
.page-action.static {
    border-color: var(--line);
    background: #ffffff;
    color: var(--green-dark);
    box-shadow: var(--shadow-sm);
}

.page-action.static {
    pointer-events: none;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
}

.container {
    width: min(100%, 1440px);
    margin: 0 auto;
}

.app-pages {
    display: block;
}

.page-view {
    display: none;
}

.page-view.active {
    display: block;
}

#page-new .form-section {
    max-width: 860px;
}

#page-new .registration-section {
    max-width: 1120px;
    padding: 24px;
    background: #ffffff;
}

#page-new .registration-intro {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

#page-new .registration-kicker {
    margin-bottom: 5px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 820;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#page-new .registration-intro h2 {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 22px;
    font-weight: 820;
    line-height: 1.25;
}

#page-new .registration-intro p:not(.registration-kicker) {
    max-width: 720px;
    color: var(--muted);
    font-size: 14px;
}

#page-new #stockForm {
    display: block;
}

#page-new .registration-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 18px;
    align-items: start;
}

#page-new .registration-panel {
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #dfe6dd;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfcfb 0%, #f6f8f5 100%);
}

#page-new .panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
}

#page-new .panel-title span {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: var(--green);
    color: #ffffff;
    font-size: 12px;
    font-weight: 850;
}

#page-new .panel-title h3 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 820;
    line-height: 1.3;
}

#page-new .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#page-new #stockForm .form-group {
    display: grid;
    gap: 7px;
    grid-column: auto;
    margin-bottom: 0;
}

#page-new label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
    color: #304038;
    font-size: 13px;
    font-weight: 800;
}

#page-new .required {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--red-soft);
    color: var(--red);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

#page-new input[type="text"],
#page-new input[type="number"],
#page-new input[type="date"],
#page-new input[type="file"],
#page-new select,
#page-new textarea {
    min-height: 48px;
    padding: 11px 13px;
    border-radius: 11px;
    background: #ffffff;
    font-size: 14px;
}

#page-new textarea {
    min-height: 136px;
}

#page-new small {
    margin-top: 0;
}

#page-new .photo-field {
    gap: 10px;
}

/* 案3: 写真・メモは折りたたみ表示 */
.registration-details {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    overflow: hidden;
}

.registration-details summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.registration-details summary::-webkit-details-marker {
    display: none;
}

.registration-details summary::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform 0.18s ease;
}

.registration-details[open] summary::before {
    transform: rotate(45deg);
}

.registration-details-body {
    display: grid;
    gap: 16px;
    padding: 4px 16px 18px;
}

#page-new .photo-preview {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(162, 77, 36, 0.06) 25%, transparent 25%) 0 0 / 18px 18px,
        linear-gradient(135deg, transparent 75%, rgba(162, 77, 36, 0.06) 75%) 0 0 / 18px 18px,
        var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

#page-new .photo-preview span {
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
}

#page-new .photo-preview.has-image {
    aspect-ratio: auto;
    border-style: solid;
    background: var(--surface-soft);
}

#page-new .photo-preview img {
    width: 100%;
    height: auto;
    max-height: min(360px, 50vh);
    object-fit: contain;
}

#page-new .photo-actions:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#page-new .photo-actions button {
    min-height: 44px;
}

#stockForm [aria-invalid="true"] {
    border: 2px solid #b42318;
}

#stockForm .field-error {
    color: #b42318;
    font-size: 14px;
    margin-top: 4px;
}

#stockForm .form-group {
    min-width: 0;
    scroll-margin-top: 24px;
}

#page-new .photo-preview img:not([hidden]) {
    display: block;
}

#page-new .photo-preview img[hidden] {
    display: none;
}

#page-new input[type="file"] {
    min-height: 46px;
    padding: 9px 11px;
}

/* 案3: バーコード読取を画面上部の主要操作として常設 */
#page-new #stockForm .scan-hero {
    margin-bottom: 20px;
    padding: 18px 20px;
    border: 2px dashed var(--green);
    border-radius: 18px;
    background: var(--green-soft);
}

.scan-hero-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.scan-hero-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 14px;
    background: var(--green);
    color: #ffffff;
}

.scan-hero-icon svg {
    width: 22px;
    height: 22px;
}

.scan-hero-head label {
    margin: 0 0 3px;
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
}

.scan-hero-sub {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

#page-new .barcode-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

#page-new .btn-scan-barcode {
    min-height: 52px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    background: var(--green);
    color: #ffffff;
    font-size: 14px;
    font-weight: 850;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(162, 77, 36, 0.24);
}

#page-new .btn-scan-barcode:hover {
    background: var(--green-dark);
}

#page-new #barcodeResult {
    color: var(--muted);
}

#page-new #barcodeResult[data-type="success"] {
    color: var(--green-dark);
    font-weight: 800;
}

#page-new #barcodeResult[data-type="error"] {
    color: var(--red);
    font-weight: 800;
}

#page-new .barcode-scanner {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #c9d8cf;
    border-radius: 12px;
    background: #f7faf7;
}

#page-new .barcode-scanner[hidden] {
    display: none;
}

#page-new .barcode-scanner video {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    background: #111;
    object-fit: cover;
}

#page-new .barcode-scanner-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

#page-new .barcode-scanner-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

#page-new .barcode-scanner-footer p[data-type="error"] {
    color: var(--red);
}

#page-new .barcode-scanner-footer .btn-cancel {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    white-space: nowrap;
}

#page-new .form-actions {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, auto);
    gap: 12px;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

#page-new .form-actions .btn-submit,
#page-new .form-actions .btn-cancel {
    width: 100%;
    min-height: 52px;
    flex: none;
    border-radius: 12px;
    font-size: 15px;
}

#page-required .check-section,
#page-expiry .expiry-section,
#page-stock-master .stock-master-section {
    max-width: 1040px;
}

.page-view > .form-section,
.page-view > .dashboard-section,
.page-view > .list-section,
.page-view > .backup-section,
.page-view > .check-section,
.page-view > .expiry-section,
.page-view > .stock-master-section {
    margin-top: 0;
}

.main-column,
.side-column {
    display: grid;
    align-content: start;
    gap: 10px;
}

h1 {
    margin-bottom: 18px;
    padding: 24px 28px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    font-size: clamp(26px, 3.4vw, 42px);
    font-weight: 800;
    letter-spacing: 0;
}

h2,
.check-result h3,
.shopping-list-section h3,
.master-section h3 {
    color: var(--text);
    font-weight: 750;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 16px;
    padding-bottom: 0;
    border: 0;
    font-size: 17px;
    line-height: 1.25;
}

.form-section,
.dashboard-section,
.list-section,
.backup-section,
.check-section,
.expiry-section,
.stock-master-section {
    margin-top: 10px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.expiry-section {
    background: rgba(255, 255, 255, 0.96);
}

.dashboard-section {
    margin-top: 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.94);
}

.main-column > .form-section,
.main-column > .dashboard-section,
.main-column > .list-section,
.main-column > .backup-section,
.main-column > .check-section,
.main-column > .expiry-section,
.main-column > .stock-master-section,
.side-column > .form-section,
.side-column > .dashboard-section,
.side-column > .list-section,
.side-column > .backup-section,
.side-column > .check-section,
.side-column > .expiry-section,
.side-column > .stock-master-section {
    margin-top: 0;
}

.form-section,
.list-section,
.check-section,
.stock-master-section {
    background: rgba(250, 252, 249, 0.96);
}

.backup-section {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
}

.backup-buttons {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

#page-settings .page-header {
    margin-bottom: 18px;
}

.settings-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 1120px;
}

.settings-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 210px;
    margin-top: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sm);
}

.settings-card-primary {
    border-color: #d5e2d8;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
}

.settings-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.settings-card-kicker {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 820;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-card h3 {
    color: var(--text);
    font-size: 18px;
    font-weight: 820;
    line-height: 1.3;
}

.settings-card-text {
    flex: 1;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.settings-card-status {
    flex: 0 0 auto;
    padding: 5px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
    white-space: nowrap;
}

.settings-card-status.is-ready {
    border-color: #cfe0d3;
    background: var(--green-soft);
    color: var(--green-dark);
}

.location-management-list {
    display: grid;
    gap: 8px;
}

.location-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.location-management-name {
    min-width: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.location-management-count {
    flex: 0 0 auto;
    padding: 4px 9px;
    border: 1px solid #d8e5db;
    border-radius: 999px;
    background: #ffffff;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 820;
    white-space: nowrap;
}

.location-management-empty {
    margin-top: 2px;
    padding: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
}

#page-settings .backup-section {
    margin-top: 0;
    padding: 20px;
}

#page-settings .backup-buttons {
    margin-top: 2px;
}

#page-stock-master .stock-master-section {
    padding: 22px;
    background: rgba(255, 255, 255, 0.96);
}

.stock-master-intro {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.stock-master-kicker {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 820;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-master-intro h2 {
    margin-bottom: 5px;
    color: var(--text);
    font-size: 22px;
    font-weight: 820;
    line-height: 1.25;
}

.stock-master-intro p:not(.stock-master-kicker) {
    max-width: 760px;
    color: var(--muted);
    font-size: 14px;
}

.stock-master-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stock-master-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(23, 32, 27, 0.03);
}

.stock-master-card[open] {
    border-color: #d7e4da;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
}

.stock-master-card summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 15px 46px 15px 16px;
    cursor: pointer;
    list-style: none;
}

.stock-master-card summary::-webkit-details-marker {
    display: none;
}

.stock-master-card summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #7d8b82;
    border-bottom: 2px solid #7d8b82;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.18s ease;
}

.stock-master-card[open] summary::after {
    transform: translateY(-35%) rotate(225deg);
}

.stock-master-category {
    min-width: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 850;
}

.stock-master-count {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid #d8e5db;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.stock-master-items {
    display: grid;
    gap: 8px;
    padding: 0 16px 16px;
    list-style: none;
}

.stock-master-items li {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.stock-master-items strong {
    color: #304038;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.35;
}

.stock-master-items span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.expiry-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.expiry-header h2 {
    margin-bottom: 5px;
    font-size: 22px;
    font-weight: 820;
}

.expiry-header p:not(.expiry-kicker) {
    max-width: 660px;
    color: var(--muted);
    font-size: 14px;
}

.expiry-kicker {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 820;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.expiry-count-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.expiry-count-details span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
}

.expiry-count-details strong {
    color: var(--text);
}

.expiry-count {
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--surface-green);
    color: var(--green-dark);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.expiry-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.expiry-summary-card {
    display: grid;
    gap: 8px;
    min-height: 104px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.expiry-summary-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.expiry-summary-card strong {
    color: var(--text);
    font-size: 30px;
    font-weight: 880;
    line-height: 1;
}

.expiry-summary-card.expired {
    border-color: #efc0bc;
    background: linear-gradient(180deg, #fff8f7 0%, var(--red-soft) 100%);
}

.expiry-summary-card.expired strong {
    color: var(--red);
}

.expiry-summary-card.soon {
    border-color: #efd797;
    background: linear-gradient(180deg, #fffdf6 0%, var(--yellow-soft) 100%);
}

.expiry-summary-card.soon strong {
    color: var(--yellow);
}

.expiry-summary-card.upcoming {
    border-color: #bfd8df;
    background: linear-gradient(180deg, #f8fcfd 0%, #edf7f9 100%);
}

.expiry-summary-card.upcoming strong {
    color: #327184;
}

.expiry-content {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.expiry-group {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
}

.expiry-group-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.expiry-group-header h3 {
    margin-bottom: 2px;
    color: var(--text);
    font-size: 16px;
    font-weight: 850;
}

.expiry-group-header p {
    color: var(--muted);
    font-size: 13px;
}

.expiry-group-header > span {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.expiry-group.expired {
    border-color: #f0c5c2;
    background: linear-gradient(180deg, #fffafa 0%, #fff6f5 100%);
}

.expiry-group.soon {
    border-color: #ead39a;
    background: linear-gradient(180deg, #fffdf8 0%, #fffaf0 100%);
}

.expiry-group.upcoming {
    border-color: #c8dfe5;
    background: linear-gradient(180deg, #f9fcfd 0%, #f2f9fb 100%);
}

.expiry-group.expired .expiry-group-header > span {
    background: var(--red-soft);
    color: var(--red);
}

.expiry-group.soon .expiry-group-header > span {
    background: var(--yellow-soft);
    color: var(--yellow);
}

.expiry-group.upcoming .expiry-group-header > span {
    background: #e8f5f7;
    color: #327184;
}

.expiry-group-list {
    display: grid;
    gap: 10px;
}

.expiry-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(124px, auto) minmax(132px, auto);
    align-items: center;
    gap: 14px;
    min-height: 104px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
    color: var(--muted);
    font-size: 14px;
}

.expiry-item-main {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.expiry-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.expiry-category-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(23, 32, 27, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 900;
}

.expiry-item .name {
    color: var(--text);
    font-size: 17px;
    font-weight: 820;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.expiry-status {
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    color: inherit;
    font-size: 12px;
    font-weight: 850;
}

.expiry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.expiry-meta span {
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid rgba(23, 32, 27, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.expiry-item-date,
.expiry-item-days {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(23, 32, 27, 0.07);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}

.expiry-item-date span,
.expiry-item-days span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.expiry-item-date strong,
.expiry-item-days strong {
    color: var(--text);
    font-weight: 850;
    white-space: nowrap;
}

.expiry-item-date strong {
    font-size: 14px;
}

.expiry-item-days {
    justify-items: center;
    text-align: center;
}

.expiry-item-days strong {
    font-size: 24px;
    line-height: 1.05;
}

.expiry-item.expired {
    border-color: #f2c6c6;
    background: var(--red-soft);
    color: #9d3030;
}

.expiry-item.expired .expiry-category-icon,
.expiry-item.expired .expiry-item-days strong {
    color: var(--red);
}

.expiry-item.expiring-soon {
    border-color: #f3dfaa;
    background: var(--yellow-soft);
    color: #8a5f12;
}

.expiry-item.expiring-soon .expiry-category-icon,
.expiry-item.expiring-soon .expiry-item-days strong {
    color: var(--yellow);
}

.expiry-item.expiring-later {
    border-color: #c8dfe5;
    background: #eff8fa;
    color: #326f80;
}

.expiry-item.expiring-later .expiry-category-icon,
.expiry-item.expiring-later .expiry-item-days strong {
    color: #327184;
}

.expiry-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 24px;
    border: 1px dashed #cbd8cf;
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 15px;
    font-weight: 760;
    text-align: center;
}

.expiry-empty.compact {
    min-height: 96px;
    background: rgba(255, 255, 255, 0.68);
    font-size: 14px;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-empty {
    min-height: 92px;
    display: grid;
    place-items: center;
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 680;
    text-align: center;
}

/* 案3: ダッシュボード上段（全体達成率ゲージ＋期限タイムライン） */
.db-hero {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.db-gauge-panel {
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.db-gauge {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.db-gauge-inner {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.db-gauge-num {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
}

.db-gauge-label {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.db-gauge-caption {
    max-width: 280px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.6;
}

.db-gauge-caption strong {
    color: var(--green-dark);
}

.db-mini-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.db-mini-pill {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.db-timeline-panel {
    padding: 18px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.db-timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.db-timeline-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.db-timeline-head a {
    font-size: 12px;
    font-weight: 750;
    color: var(--green-dark);
    text-decoration: none;
}

.db-timeline-track-wrap {
    position: relative;
    height: 150px;
    margin: 0 8px;
    overflow-x: hidden;
}

.db-timeline-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 75px;
    height: 3px;
    background: var(--line-strong);
    border-radius: 999px;
}

.db-timeline-tick {
    position: absolute;
    top: 69px;
    width: 1px;
    height: 15px;
    background: var(--line-strong);
}

.db-timeline-tick-label {
    position: absolute;
    top: 88px;
    transform: translateX(-50%);
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.db-timeline-flag {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    transform: translateX(-50%);
}

.db-timeline-flag.above {
    bottom: 88px;
    flex-direction: column-reverse;
}

.db-timeline-flag.below {
    top: 86px;
}

.db-timeline-chip {
    width: 100%;
    padding: 6px 9px;
    border-radius: 10px;
    border: 1px solid;
    text-align: center;
    font-size: 10.5px;
    font-weight: 750;
}

.db-timeline-chip strong {
    display: block;
    margin-bottom: 1px;
    font-size: 11px;
}

.db-timeline-stem {
    width: 1px;
    height: 14px;
    flex: 0 0 auto;
}

.db-timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    flex: 0 0 auto;
}

/* 案3: カテゴリ優先度リスト＋保管場所内訳 */
.db-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.db-cat-panel,
.db-loc-panel {
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.db-cat-block {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.db-cat-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.db-cat-block-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.db-cat-block-head span {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.db-cat-divider {
    height: 1px;
    background: var(--line);
}

.db-cat-ring-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.db-cat-ring-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 78px;
}

.db-cat-ring {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.db-cat-ring-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-cat-ring-pct {
    font-size: 13.5px;
    font-weight: 850;
    line-height: 1;
}

.db-cat-ring-name {
    color: var(--text);
    font-size: 10.5px;
    font-weight: 750;
    text-align: center;
}

.db-cat-ring-status {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 8.5px;
    font-weight: 800;
}

.db-cat-good-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.db-cat-good-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.db-cat-good-ini {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    border-radius: 6px;
    background: var(--surface-green);
    color: var(--green-dark);
    font-size: 8.5px;
    font-weight: 800;
}

.db-cat-good-name {
    color: var(--text);
    font-size: 11px;
    font-weight: 750;
}

.db-cat-good-pct {
    font-size: 10.5px;
    font-weight: 850;
}

.db-cat-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 12.5px;
}

.db-loc-bar {
    display: flex;
    height: 20px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.db-loc-seg {
    height: 100%;
}

.db-loc-legend {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.db-loc-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.db-loc-legend-left {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.db-loc-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 3px;
}

.db-loc-legend-item strong {
    color: var(--text);
    font-weight: 750;
}

@media (max-width: 979px) {
    .db-hero,
    .db-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .db-timeline-flag {
        width: 92px;
    }

    .db-timeline-chip {
        padding: 5px 7px;
        font-size: 9.5px;
    }

    .db-timeline-chip strong {
        font-size: 10px;
    }

    .db-gauge-panel {
        padding: 16px;
    }
}

.form-group {
    margin-bottom: 12px;
}

#stockForm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

#stockForm .form-group {
    margin-bottom: 0;
}

#stockForm .form-group:first-child,
#stockForm .form-group:nth-of-type(7),
#stockForm .form-group:nth-of-type(8),
#stockForm .form-actions {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.required {
    color: var(--red);
    font-weight: 800;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-soft);
}

input[type="file"] {
    padding-top: 8px;
}

textarea {
    min-height: 104px;
    resize: vertical;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: var(--focus);
    background: #ffffff;
}

small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.form-actions,
.backup-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    font: inherit;
}

.btn-submit,
.btn-cancel,
.btn-check,
.btn-copy-list,
.btn-edit,
.btn-delete,
.qty-btn {
    border: 0;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-submit,
.btn-cancel,
.btn-check,
.btn-copy-list {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 760;
}

.btn-submit,
.btn-check {
    background: var(--green);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(162, 77, 36, 0.16);
}

.btn-submit:hover,
.btn-check:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(162, 77, 36, 0.2);
}

.btn-cancel {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--text);
}

.btn-cancel:hover {
    background: var(--line);
    transform: translateY(-1px);
}

.btn-copy-list {
    width: 100%;
    background: var(--yellow);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(216, 155, 35, 0.18);
}

.btn-copy-list:hover {
    background: #bd8519;
    transform: translateY(-1px);
}

.form-actions .btn-submit,
.form-actions .btn-cancel,
.backup-buttons .btn-submit,
.backup-buttons .btn-cancel {
    flex: 1 1 180px;
}

.search-section {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 1fr) minmax(160px, 1fr);
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

#page-inventory .page-header {
    align-items: flex-end;
    margin-bottom: 18px;
}

#page-inventory .inventory-list-section {
    padding: 22px;
    background: rgba(255, 255, 255, 0.96);
}

#page-inventory .inventory-list-section > h2 {
    display: none;
}

.inventory-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.inventory-kicker {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 820;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.inventory-intro h2 {
    margin-bottom: 5px;
    color: var(--text);
    font-size: 20px;
    font-weight: 820;
    line-height: 1.25;
}

.inventory-intro p:not(.inventory-kicker) {
    color: var(--muted);
    font-size: 13px;
}

#page-inventory .search-section {
    align-items: end;
    margin-bottom: 20px;
    padding: 14px;
    border-color: #dfe6dd;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfcfb 0%, #f4f7f4 100%);
}

.filter-field {
    display: grid;
    gap: 7px;
    margin: 0;
}

.filter-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}


.stock-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.inventory-section-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.stock-list > .inventory-section-head:first-child {
    margin-top: 0;
}

.inventory-section-head h3 {
    margin: 0;
    min-width: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 820;
    overflow-wrap: anywhere;
}

.inventory-section-count {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.inventory-section-alert {
    margin-left: auto;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
}

.inventory-section-alert.is-danger {
    background: var(--red-soft);
    color: var(--red);
}

.inventory-section-alert.is-warning {
    background: var(--yellow-soft);
    color: var(--yellow);
}

.empty-message {
    grid-column: 1 / -1;
    padding: 34px 18px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
    font-weight: 650;
}

#page-inventory .empty-message {
    font-size: 0;
}

#page-inventory .empty-message::after {
    content: "条件に一致する備蓄品はありません";
    font-size: 14px;
}

.stock-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 336px;
    height: 100%;
    overflow: hidden;
    padding: 16px;
    border: 1px solid #e3e8df;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
    box-shadow: 0 1px 2px rgba(23, 32, 27, 0.04), 0 14px 30px rgba(23, 32, 27, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stock-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.stock-card.expiring-soon {
    border-color: #f0dea9;
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 42%);
}

.stock-card.expired {
    border-color: #f0c7c7;
    background: linear-gradient(180deg, #fff4f4 0%, #ffffff 42%);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    margin-bottom: 14px;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.card-title-group {
    min-width: 0;
}

.product-name {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 17px;
    font-weight: 820;
    line-height: 1.32;
    overflow-wrap: anywhere;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-green);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 760;
}

.btn-edit,
.btn-delete {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 820;
}

.btn-edit {
    background: var(--green);
}

.btn-edit:hover {
    background: var(--green-dark);
}

.btn-delete {
    background: var(--red);
}

.btn-delete:hover {
    background: #b73c3c;
}

.card-body {
    display: grid;
    gap: 9px;
    flex: 1;
    align-content: start;
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(249, 250, 248, 0.82);
    font-size: 13px;
}

.card-item:last-child {
    border-bottom: 1px solid var(--line);
}

.card-label {
    color: var(--muted);
    font-weight: 700;
}

.card-value {
    color: var(--text);
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.quantity-row {
    align-items: center;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #ffffff;
}

.qty-btn {
    width: 34px;
    height: 34px;
    background: transparent;
    color: var(--text);
    font-size: 17px;
    font-weight: 850;
}

.qty-btn:hover {
    background: var(--green-soft);
    color: var(--green-dark);
}

.quantity-control .card-value {
    min-width: 42px;
    padding: 0 4px;
    text-align: center;
}

.expiry-date {
    display: grid;
    gap: 3px;
    margin-top: 2px;
    padding: 10px 12px;
    border: 1px solid #cde7d1;
    border-radius: 12px;
    background: var(--green-soft);
    color: var(--green-dark);
    text-align: center;
    font-size: 13px;
    font-weight: 800;
}

.expiry-date span {
    color: inherit;
    font-size: 11px;
    font-weight: 820;
    opacity: 0.78;
}

.expiry-date strong {
    color: inherit;
    font-size: 13px;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.expiry-date.expiring-soon {
    border-color: #f0dea9;
    background: var(--yellow-soft);
    color: #8a5f12;
}

.expiry-date.expired {
    border-color: #f0c7c7;
    background: var(--red-soft);
    color: #9d3030;
}

.expiry-date.valid {
    border-color: #cde7d1;
    background: var(--green-soft);
    color: var(--green-dark);
}

.memo {
    display: grid;
    gap: 4px;
    margin-top: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.memo strong {
    color: var(--text);
    font-size: 12px;
}

.check-settings {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.4fr) auto;
    gap: 14px;
    align-items: end;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
    box-shadow: var(--shadow-sm);
}

.settings-group {
    display: flex;
    flex-direction: column;
}

.settings-group label {
    font-size: 13px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.input-group .unit {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
}

.radio-label input[type="radio"] {
    width: auto;
    accent-color: var(--green);
}

.check-result,
.shopping-list-section,
.master-section {
    margin-top: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.check-result h3,
.shopping-list-section h3,
.master-section h3 {
    margin-bottom: 12px;
    padding-bottom: 0;
    border: 0;
    font-size: 16px;
}

.result-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.result-item {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.result-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--green);
}

.result-item.ok {
    border-color: #cde7d1;
    background: var(--green-soft);
}

.result-item.shortage {
    border-color: #f0c7c7;
    background: var(--red-soft);
}

.result-item.shortage::before {
    background: var(--red);
}

.result-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.result-item-name {
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
}

.result-status {
    padding: 5px 10px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.result-status.ok {
    background: var(--green);
}

.result-status.shortage {
    background: var(--red);
}

.result-details {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.detail-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.detail-label {
    color: var(--muted);
    font-weight: 700;
}

.detail-value {
    color: var(--text);
    font-weight: 850;
}

.shopping-list-content {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid #f0dea9;
    border-radius: var(--radius);
    background: var(--yellow-soft);
}

.shopping-list-empty {
    padding: 18px;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(216, 155, 35, 0.18);
}

.shopping-item:last-child {
    border-bottom: 0;
}

.shopping-item input[type="checkbox"] {
    width: 19px;
    height: 19px;
    accent-color: var(--green);
    cursor: pointer;
}

.shopping-item-text {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.master-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.master-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    font-size: 13px;
    font-weight: 750;
}

.master-item.registered {
    border-color: #cde7d1;
    background: var(--green-soft);
    color: var(--green-dark);
}

.master-item.missing {
    border-color: #f0c7c7;
    background: var(--red-soft);
    color: #9d3030;
}

.master-name {
    overflow-wrap: anywhere;
}

.master-item .status-badge {
    flex-shrink: 0;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: inherit;
    font-size: 11px;
    font-weight: 850;
}

#page-required .check-section {
    max-width: 1180px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.96);
}

.required-intro {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.required-kicker,
.section-kicker {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 820;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.required-intro h2 {
    margin-bottom: 5px;
    color: var(--text);
    font-size: 22px;
    font-weight: 820;
    line-height: 1.25;
}

.required-intro p:not(.required-kicker) {
    max-width: 720px;
    color: var(--muted);
    font-size: 14px;
}

#page-required .check-settings {
    grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.1fr) minmax(180px, auto);
    margin-bottom: 16px;
    padding: 16px;
    border-color: #dfe6dd;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfcfb 0%, #f4f7f4 100%);
}

#page-required .settings-group {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
}

#page-required .settings-group label {
    margin-bottom: 8px;
    color: #304038;
    font-size: 13px;
    font-weight: 800;
}

#page-required .input-group input {
    min-width: 0;
}

#page-required .btn-check {
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
}

.required-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
    gap: 14px;
    align-items: start;
}

.required-main,
.required-side {
    display: grid;
    gap: 14px;
    min-width: 0;
}

#page-required .check-result,
#page-required .weekly-top-section,
#page-required .shopping-list-section,
#page-required .master-section {
    margin-top: 0;
    padding: 16px;
    border-radius: 14px;
    background: #ffffff;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

#page-required .check-result h3,
#page-required .weekly-top-section h3,
#page-required .shopping-list-section h3,
#page-required .master-section h3 {
    margin-bottom: 0;
    font-size: 16px;
    font-weight: 820;
}

#page-required .weekly-top-section {
    position: relative;
    border-color: #eadbb8;
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
}

@media (min-width: 980px) {
    #page-required .weekly-top-section::after {
        content: "";
        position: absolute;
        top: 50%;
        right: -15px;
        width: 15px;
        border-top: 2px dashed #e4c77d;
    }
}

#page-required .weekly-top-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#page-required .weekly-top-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    min-height: 104px;
    padding: 12px;
    border: 1px solid #f0dea9;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(23, 32, 27, 0.04), 0 12px 24px rgba(184, 135, 46, 0.08);
}

#page-required .weekly-top-rank {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--yellow);
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

#page-required .weekly-top-body {
    display: grid;
    gap: 8px;
    min-width: 0;
}

#page-required .weekly-top-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

#page-required .weekly-top-category {
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
}

#page-required .weekly-top-shortage {
    color: #966912;
    font-size: 11px;
    font-weight: 850;
    text-align: right;
    white-space: nowrap;
}

#page-required .weekly-top-target {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

#page-required .weekly-top-empty {
    padding: 18px;
    border: 1px solid #cde7d1;
    border-radius: 12px;
    background: var(--green-soft);
    color: var(--green-dark);
    text-align: center;
    font-weight: 800;
}

#page-required .result-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#page-required .result-item {
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
}

#page-required .result-item.ok {
    border-color: #b9d9c1;
    background: linear-gradient(180deg, #f7fcf8 0%, #eef7f0 100%);
}

#page-required .result-item.shortage {
    border-color: #edc2bf;
    background: linear-gradient(180deg, #fffafa 0%, #fff0ef 100%);
}

.result-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.result-metric {
    display: grid;
    gap: 5px;
    min-width: 0;
    min-height: 70px;
    padding: 10px;
    border: 1px solid rgba(23, 32, 27, 0.08);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.78);
}

.result-metric .detail-label,
.progress-label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.result-metric .detail-value {
    color: var(--text);
    font-size: 17px;
    font-weight: 850;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.result-metric.deficit .detail-value {
    color: var(--red);
}

.result-metric.surplus .detail-value {
    color: var(--green-dark);
}

.progress-summary {
    display: grid;
    gap: 7px;
}

.progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.progress-label strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.progress-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(23, 32, 27, 0.08);
    box-shadow: inset 0 0 0 1px rgba(23, 32, 27, 0.04);
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.result-item.shortage .progress-bar span {
    background: var(--red);
}

#page-required .shopping-list-content {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0;
    border: 0;
    background: transparent;
}

#page-required .shopping-item {
    align-items: flex-start;
    min-height: 92px;
    padding: 12px;
    border: 1px solid #efd0cd;
    border-radius: 12px;
    background: var(--red-soft);
}

#page-required .shopping-checkbox {
    flex: 0 0 auto;
    margin-top: 3px;
}

#page-required .shopping-item-body {
    display: grid;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

#page-required .shopping-item-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#page-required .shopping-priority {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--red);
    color: #ffffff;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

#page-required .shopping-category {
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
}

#page-required .shopping-shortage {
    margin-left: auto;
    color: var(--red);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

#page-required .shopping-buy-target {
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
    line-height: 1.35;
}

#page-required .shopping-candidates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#page-required .shopping-candidates span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 8px;
    border: 1px solid rgba(189, 85, 80, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: #823633;
    font-size: 12px;
    font-weight: 760;
}

#page-required .shopping-item-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

#page-required .shopping-item-text strong {
    color: var(--text);
    font-size: 14px;
}

#page-required .shopping-item-text span {
    color: var(--red);
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

#page-required .shopping-list-empty {
    border: 1px solid #cde7d1;
    border-radius: 12px;
    background: var(--green-soft);
    color: var(--green-dark);
}

#page-required .master-content {
    grid-template-columns: 1fr;
    gap: 8px;
}

#page-required .master-item {
    min-height: 46px;
    border-radius: 12px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (min-width: 980px) {
    body {
        padding: 0;
    }

    .container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 12px;
        align-items: start;
    }

    .container.app-pages {
        display: block;
    }

    .main-column,
    .side-column {
        gap: 12px;
    }

    .stock-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .form-section h2,
    .backup-section h2 {
        margin-bottom: 10px;
    }
}

@media (max-width: 899px) {
    .app-main {
        padding: 18px 14px 100px;
    }
}

@media (min-width: 1280px) {
    .container {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 14px;
    }

    .container.app-pages {
        display: block;
    }
}

@media (max-width: 979px) {
    .check-settings {
        grid-template-columns: 1fr;
    }

    .required-grid,
    #page-required .weekly-top-content,
    #page-required .result-content {
        grid-template-columns: 1fr;
    }

    .settings-overview {
        grid-template-columns: 1fr;
    }

    #page-new .registration-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    body {
        padding: 0;
    }

    h1 {
        padding: 20px;
        border-radius: 20px;
        font-size: 26px;
    }

    .form-section,
    .dashboard-section,
    .list-section,
    .backup-section,
    .check-section,
    .expiry-section,
    .stock-master-section {
        margin-top: 14px;
        padding: 18px;
        border-radius: 16px;
    }

    .expiry-section,
    .stock-master-section {
        margin-top: 0;
    }

    #page-settings .backup-section {
        margin-top: 0;
        padding: 18px;
    }

    .search-section,
    .stock-list,
    .expiry-summary-cards,
    .expiry-item,
    .result-content,
    .master-content,
    .stock-master-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .page-header h2 {
        font-size: 24px;
    }

    .page-action {
        width: 100%;
    }

    #stockForm {
        grid-template-columns: 1fr;
    }

    #page-new .registration-section {
        padding: 18px;
    }

    #page-new .registration-intro h2 {
        font-size: 20px;
    }

    #page-new .form-row,
    #page-new .barcode-input-row,
    #page-new .barcode-scanner-footer,
    #page-new .form-actions {
        grid-template-columns: 1fr;
    }

    .card-header,
    .result-item-header,
    .expiry-item {
        align-items: flex-start;
    }

    .expiry-item {
        gap: 10px;
    }

    .card-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .quantity-row {
        flex-direction: row;
        align-items: center;
    }

    .card-value {
        text-align: left;
    }

    #page-required .check-section {
        padding: 18px;
    }

    #page-required .check-settings {
        grid-template-columns: 1fr;
    }

    .result-metrics {
        grid-template-columns: 1fr;
    }

    #page-required .shopping-item-text {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    #page-required .shopping-item-text span {
        white-space: normal;
    }

    #page-required .shopping-shortage {
        width: 100%;
        margin-left: 0;
        white-space: normal;
    }

    #page-required .weekly-top-main {
        display: grid;
        gap: 3px;
    }

    #page-required .weekly-top-shortage {
        text-align: left;
        white-space: normal;
    }
}

@media (max-width: 440px) {
    .form-actions,
    .backup-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .settings-card {
        min-height: 0;
        padding: 16px;
    }

    .settings-card-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .card-header {
        flex-direction: column;
    }

    .card-actions {
        width: 100%;
    }

    .btn-edit,
    .btn-delete {
        flex: 1;
    }

    .radio-label {
        flex: 1 1 90px;
        justify-content: center;
    }
}

/* ログイン画面（世帯名＋合言葉） */
.login-screen {
    display: none;
}

body.auth-locked .app-shell {
    display: none;
}

body.auth-locked .login-screen {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.login-screen [hidden] {
    display: none !important;
}

.login-card {
    display: grid;
    gap: 16px;
    width: min(100%, 400px);
    padding: 28px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-lead,
.login-checking {
    color: var(--muted);
    font-size: 14px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-field {
    display: grid;
    gap: 6px;
}

.login-field label {
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 800;
}

.login-field input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

.login-field input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: var(--focus);
}

.login-message {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--red-soft);
    color: var(--red);
    font-size: 13px;
    font-weight: 750;
}

.login-submit {
    width: 100%;
    min-height: 50px;
}

.login-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* クラウド保存の状態表示 */
.header-status[data-state="saving"] {
    opacity: 0.75;
}

.header-status[data-state="failed"] {
    background: var(--red-soft);
    color: var(--red);
    cursor: pointer;
}

.header-status[data-state="failed"] .status-dot {
    background: var(--red);
}
