/* ===== THEME TOKENS ===== */
:root[data-theme="dark"] {
    /* Moss & Olive Palette */
    --color-moss-deep:  #1a1c18;
    --color-moss-dark:  #2d3329;
    --color-moss-base:  #4a5441;
    --color-moss-light: #8fbc8f;
    --color-olive-dark: #556b2f;
    --color-olive-base: #6b8e23;
    --color-olive-light:#a9ba9d;
    --color-gold-muted: #bdb76b;

    /* UI Colors */
    --bg-main:       var(--color-moss-deep);
    --bg-sidebar:    rgba(45, 51, 41, 0.85);
    --bg-card:       #242821;
    --bg-elevated:   #2a2f25;
    --text-primary:  #f1f3ec;
    --text-secondary:#a9ba9d;
    --text-muted:    #6c7a5e;
    --border:        var(--color-moss-base);
    --accent:        #d4e157;
    --urgent:        #ff8a65;
    --success:       #81c784;
    --error:         #c0413c;
    --warn:          #d4a017;
    --link:          var(--accent);
    --glass-border:  rgba(255, 255, 255, 0.05);
}

:root[data-theme="light"] {
    --color-moss-deep:  #f4f1e6;
    --color-moss-dark:  #e7e3d2;
    --color-moss-base:  #c8c8b0;
    --color-moss-light: #6b8e23;
    --color-olive-dark: #3f5020;
    --color-olive-base: #556b2f;
    --color-olive-light:#4a5441;
    --color-gold-muted: #8a7c2a;

    --bg-main:       #f7f5ec;
    --bg-sidebar:    rgba(231, 227, 210, 0.85);
    --bg-card:       #ffffff;
    --bg-elevated:   #f0ecdc;
    --text-primary:  #1a1c18;
    --text-secondary:#4a5441;
    --text-muted:    #8a9078;
    --border:        #c8c8b0;
    --accent:        #6b8e23;
    --urgent:        #d2691e;
    --success:       #4a7c4a;
    --error:         #b03a2e;
    --warn:          #b8860b;
    --link:          #556b2f;
    --glass-border:  rgba(0, 0, 0, 0.06);
}

:root {
    --sidebar-width: 260px;
    --font-family: 'Roboto Mono', 'Noto Sans Mono CJK JP', 'Source Han Code JP', monospace;
    --radius-lg: 8px;
    --radius-md: 6px;
    --radius-sm: 4px;
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --spacing-base: 1.5rem;
    --spacing-tight: 1rem;
}

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

html {
    font-size: 13px;
}

body {
    font-family: var(--font-family);
    font-size: 13px;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 2rem;    font-weight: 700; color: var(--text-primary);        line-height: 1.2; }
h2 { font-size: 1.5rem;  font-weight: 700; color: var(--text-primary);        line-height: 1.25; }
h3 { font-size: 1.15rem; font-weight: 600; color: var(--accent);              line-height: 1.3; }
h4 { font-size: 1rem;    font-weight: 600; color: var(--color-olive-light);   text-transform: uppercase; letter-spacing: 0.05em; }
h5 { font-size: 0.85rem; font-weight: 600; color: var(--text-primary);        text-transform: uppercase; letter-spacing: 0.1em; }
h6 { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary);      text-transform: uppercase; letter-spacing: 0.15em; }

p { color: var(--text-primary); }
p + p { margin-top: 0.5rem; }

a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-style: dashed;
    transition: var(--transition);
}
a:hover { opacity: 0.75; }

code {
    font-family: var(--font-family);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    font-size: 12px;
    color: var(--accent);
}

pre {
    font-family: var(--font-family);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 12px;
    color: var(--text-primary);
    overflow-x: auto;
    line-height: 1.5;
}

blockquote {
    border-left: 3px solid var(--accent);
    background: var(--bg-elevated);
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    font-style: italic;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===== TEXT UTILITIES ===== */
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); font-size: 11px; }
.text-accent    { color: var(--accent); font-weight: 500; }
.text-success   { color: var(--success); }
.text-warn      { color: var(--warn); }
.text-error     { color: var(--error); }
.text-urgent    { color: var(--urgent); }

/* ===== PANEL TITLE ===== */
.panel-title {
    color: var(--color-olive-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.panel-title svg,
.panel-title i { width: 14px; height: 14px; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid;
}
.badge svg, .badge i { width: 11px; height: 11px; }
.badge-success { background: rgba(129,199,132,0.15); color: var(--success); border-color: var(--success); }
.badge-warn    { background: rgba(212,160,23,0.15);  color: var(--warn);    border-color: var(--warn); }
.badge-error   { background: rgba(192,65,60,0.15);   color: var(--error);   border-color: var(--error); }
.badge-accent  { background: rgba(212,225,87,0.15);  color: var(--accent);  border-color: var(--accent); }

/* ===== NOTIFICATIONS ===== */
.notif {
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
}
.notif svg, .notif i { width: 14px; height: 14px; flex-shrink: 0; }
.notif-success { background: rgba(129,199,132,0.12); color: var(--success); border-color: var(--success); }
.notif-error   { background: rgba(255,138,101,0.12); color: var(--urgent);  border-color: var(--urgent); }
.notif-warn    { background: rgba(212,160,23,0.12);  color: var(--warn);    border-color: var(--warn); }
.notif-info    { background: rgba(212,225,87,0.10);  color: var(--accent);  border-color: var(--accent); }

/* ===== Layout ===== */

/* ===== App Header ===== */
.app-header {
    background: var(--bg-card);
    border-bottom: 1px dashed var(--border);
    flex-shrink: 0;
}

.app-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.brand-mark svg,
.brand-mark i {
    width: 28px;
    height: 28px;
    color: var(--accent);
}
.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
}
.brand-sub {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 1px;
}

/* ===== Tab Nav ===== */
.tab-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}

.tab-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.tab-btn {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== Main Content Area ===== */
.main-content {
    background-color: var(--bg-main);
    flex: 1;
    overflow-y: auto;
}

/* ===== Grid utility ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 700px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ===== Views Management ===== */
.view-active {
    display: block;
    animation: fadeIn 0.3s;
}

.view-hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0.5;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Tools Menu ===== */
.tools-menu {
    padding: 2.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tools-menu h2 {
    margin-bottom: 1.5rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* ===== Tool Cards ===== */
.tool-card {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.tool-card:hover .tool-icon {
    transform: scale(1.05);
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: var(--bg-elevated);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.tool-details h3 {
    margin-bottom: 6px;
}

.tool-details p {
    color: var(--text-secondary);
}

/* ===== Tool Views ===== */
.tool-view {
    padding: 2.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.view-header {
    display: flex;
    align-items: center;
}

.view-header h2 {
    /* inherits from global h2 */
}

.tool-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ===== THEME SWITCH ===== */
.theme-switch {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem;
}
.theme-switch button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}
.theme-switch button svg,
.theme-switch button i { width: 14px; height: 14px; }
.theme-switch button.active {
    background: var(--color-olive-dark);
    color: #fff;
}
:root[data-theme="light"] .theme-switch button.active {
    background: var(--color-olive-base);
    color: #fff;
}

/* ===== BUTTONS ===== */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

button.btn, .btn {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    border: 1px solid transparent;
}
button.btn svg, .btn svg,
button.btn i, .btn i { width: 14px; height: 14px; }

.btn-primary {
    background: var(--accent);
    color: var(--bg-card);
    font-weight: 600;
    border-color: var(--accent);
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
    background: var(--color-olive-dark);
    color: #fff;
    border-color: var(--color-olive-dark);
}
.btn-secondary:hover {
    background: var(--color-olive-base);
    border-color: var(--color-olive-base);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.4rem;
}
.btn-icon:hover { color: var(--accent); transform: scale(1.1); }

.btn-danger {
    background: transparent;
    color: var(--urgent);
    border-color: var(--urgent);
}
.btn-danger:hover { background: var(--urgent); color: var(--bg-card); }

/* Back button */
.back-btn {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    margin-right: 1rem;
}
.back-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.back-btn svg, .back-btn i { width: 16px; height: 16px; }

/* ===== Panel ===== */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
}

/* ===== Inputs ===== */
input[type="text"],
input[type="email"],
input[type="number"] {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
}
input::placeholder { color: var(--text-muted); }

textarea {
    width: 100%;
    min-height: 220px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

textarea:focus { border-color: var(--accent); }

select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    width: 100%;
    transition: var(--transition);
}
select:focus {
    outline: none;
    border-color: var(--accent);
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.field { margin-bottom: 0.75rem; }

.textarea-container {
    display: flex;
    flex-direction: column;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.output-header label { margin-bottom: 0; }

/* ===== Phone Formatter ===== */
.controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.badge-toggle {
    background-color: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.badge-toggle:hover { border-color: var(--accent); }

.badge-toggle.active {
    background-color: var(--color-olive-dark);
    color: #fff;
    border-color: var(--color-olive-dark);
}
:root[data-theme="light"] .badge-toggle.active {
    background: var(--color-olive-base);
    color: #fff;
    border-color: var(--color-olive-base);
}

.side-by-side-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
}

@media (max-width: 800px) {
    .side-by-side-container { grid-template-columns: 1fr; }
}

#phone-output {
    background-color: var(--bg-elevated);
    cursor: default;
}

/* ===== Salesforce Icon Converter ===== */
.sf-icon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 960px) {
    .sf-icon-grid { grid-template-columns: 1fr; }
}

.sf-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-width: 0;
    overflow: hidden;
}

.sf-panel-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 600;
}

.sf-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 14px 0 6px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sf-label:first-of-type { margin-top: 0; }

.sf-input,
.sf-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.sf-input:focus,
.sf-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.sf-textarea {
    resize: vertical;
    height: auto;
    min-height: 160px;
    max-width: 100%;
    display: block;
    white-space: pre;
    overflow: auto;
}

.sf-size-input { width: 130px; }

.sf-hex-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sf-hex-input {
    width: 130px;
    text-transform: uppercase;
}

.sf-swatch-preview {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #0070D2;
}

.sf-error {
    color: var(--urgent);
    font-size: 0.825rem;
    background: rgba(255, 138, 101, 0.1);
    border: 1px solid rgba(255, 138, 101, 0.3);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    margin-top: 10px;
    display: none;
}

.sf-previews { display: grid; gap: 16px; }

.sf-preview-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    background: var(--bg-elevated);
}

.sf-canvas-wrap {
    background-image:
        linear-gradient(45deg, var(--color-moss-base) 25%, transparent 25%),
        linear-gradient(-45deg, var(--color-moss-base) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--color-moss-base) 75%),
        linear-gradient(-45deg, transparent 75%, var(--color-moss-base) 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-preview-card canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.sf-preview-meta { font-size: 0.875rem; }
.sf-preview-title { font-weight: 600; color: var(--text-primary); }
.sf-preview-desc { color: var(--text-secondary); font-size: 0.8rem; margin-top: 2px; }
.sf-preview-desc code,
.sf-preview-desc strong,
.sf-preview-desc em { color: var(--text-primary); }
.sf-preview-desc code { font-family: 'Roboto Mono', monospace; font-size: 0.78rem; }

.sf-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.5;
}
.sf-hint code {
    font-family: 'Roboto Mono', monospace;
    background: var(--bg-elevated);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    color: var(--accent);
}

.sf-usage-section { margin-top: 24px; }

.sf-usage-intro {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 18px;
}
.sf-usage-intro code {
    font-family: 'Roboto Mono', monospace;
    background: var(--bg-elevated);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.82rem;
}

.sf-snippet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 14px;
}

.sf-snippet {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sf-snippet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.sf-snippet-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    font-weight: 600;
}

.sf-snippet pre {
    margin: 0;
    padding: 12px 14px;
    overflow-x: auto;
    flex: 1;
}

.sf-snippet code {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.55;
    white-space: pre;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-moss-dark); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-moss-base); }

/* ===== Social Insurance Tracker (sit-*) ===== */
.sit-config {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 800px) { .sit-config { grid-template-columns: 1fr; } }

.sit-yen-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}
.sit-yen-wrap:focus-within { border-color: var(--accent); }
.sit-yen-wrap > span {
    padding: 0.5rem 0.6rem;
    color: var(--text-muted);
    font-size: 12px;
    border-right: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}
.sit-yen-wrap input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 0.5rem 0.6rem;
    font-family: inherit;
    font-size: 13px;
    width: 100%;
    outline: none;
}
.sit-yen-wrap input[readonly] { color: var(--text-muted); cursor: default; }

.sit-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 800px) { .sit-months { grid-template-columns: 1fr; } }

.sit-month {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-left: 3px solid var(--border);
    transition: var(--transition);
}
.sit-month.sit-locked { border-left-color: var(--warn); }
.sit-month.sit-unlocked { border-left-color: var(--color-moss-base); }

.sit-month-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sit-month-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}
.sit-kanji {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    margin-left: 4px;
}
.sit-lock-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.sit-lock-label input { cursor: pointer; accent-color: var(--warn); }

.sit-mode-row {
    display: flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    gap: 0;
}
.sit-mode-btn {
    flex: 1;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}
.sit-mode-btn.active {
    background: var(--color-olive-dark);
    color: #fff;
}
:root[data-theme="light"] .sit-mode-btn.active { background: var(--color-olive-base); }

.sit-ot-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.6rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
    outline: none;
}
.sit-ot-input:focus { border-color: var(--accent); }

.sit-month-ft {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
}
.sit-month-gross {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}

/* Dashboard */
.sit-avg-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.sit-avg-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.sit-avg-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Status badges */
.sit-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
    margin-top: 0.5rem;
}
.sit-badge-green { background: rgba(129,199,132,.15); color: var(--success); border-color: var(--success); }
.sit-badge-warn  { background: rgba(212,160,23,.15);  color: var(--warn);    border-color: var(--warn); }
.sit-badge-red   { background: rgba(192,65,60,.15);   color: var(--error);   border-color: var(--error); }

/* Bracket bar */
.sit-bar-wrap { margin-bottom: 1.5rem; }
.sit-bar-track {
    position: relative;
    height: 28px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    overflow: visible;
}
.sit-bar-safe {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(129,199,132,.15);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: 2px dashed var(--success);
    pointer-events: none;
}
.sit-tick {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.sit-tick-line {
    width: 1px;
    height: 100%;
    background: var(--border);
}
.sit-tick-label {
    font-size: 9px;
    color: var(--text-muted);
    position: absolute;
    bottom: -16px;
    white-space: nowrap;
    transform: translateX(-50%);
}
.sit-tick-key .sit-tick-line { background: var(--warn); }
.sit-tick-key .sit-tick-label { color: var(--warn); }
.sit-bar-marker {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    transform: translateX(-50%);
}
.sit-bar-dot {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    margin-top: 8px;
    box-shadow: 0 0 0 2px var(--accent);
}
.sit-bar-val {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    position: absolute;
    top: -18px;
    white-space: nowrap;
    transform: translateX(-50%);
}
.sit-bar-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 20px;
}
.sit-legend-safe {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: rgba(129,199,132,.4);
    border: 1px solid var(--success);
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.sit-panels-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 900px) { .sit-panels-2 { grid-template-columns: 1fr; } }

.sit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.sit-table th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    text-align: left;
    padding: 7px 10px;
    border-bottom: 2px solid var(--border);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.sit-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
.sit-table tr:last-child td { border-bottom: none; }
.sit-table .sit-impact-proj td { background: rgba(212,225,87,.07); font-weight: 600; }
.sit-table .sit-impact-curr td { color: var(--text-muted); }
.sit-td-num { text-align: right; font-variant-numeric: tabular-nums; }
.sit-delta-up { color: var(--error) !important; font-weight: 600; }
.sit-delta-dn { color: var(--success) !important; font-weight: 600; }

/* ===== THEMES VIEW ===== */
.themes-layout {
    display: flex;
    gap: 0;
    min-height: 500px;
}

.themes-subnav {
    width: 180px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0;
    align-self: flex-start;
}

.themes-subnav-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 0.5rem 1.25rem 0.75rem;
}

.themes-subnav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.themes-subnav-item svg,
.themes-subnav-item i { width: 14px; height: 14px; }

.themes-subnav-item:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.themes-subnav-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--bg-elevated);
}

.themes-content {
    flex: 1;
    min-width: 0;
    padding-left: 1.5rem;
}

.theme-page { display: flex; flex-direction: column; gap: 1.25rem; }

.color-pickers-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.color-picker-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.color-picker-group label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0;
}
.color-picker-group input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    cursor: pointer;
    background: transparent;
}
.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-group input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }
.color-picker-group .hex-value {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-family);
}

/* Theme Mockup */
.theme-mockup {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 340px;
    background: var(--m-bg, #1a1c18);
    color: var(--m-text, #f1f3ec);
}

.mock-sidebar {
    width: 180px;
    flex-shrink: 0;
    background: var(--m-surface, #242821);
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 1rem;
}

.mock-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.mock-brand-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: var(--m-accent, #d4e157);
}
.mock-brand-text {
    width: 80px;
    height: 10px;
    border-radius: 3px;
    background: var(--m-text, #f1f3ec);
    opacity: 0.6;
}

.mock-nav-section { display: flex; flex-direction: column; gap: 2px; }

.mock-nav-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--m-secondary, #a9ba9d);
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.mock-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.mock-nav-item.active {
    background: rgba(255,255,255,0.06);
}

.mock-nav-icon {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--m-secondary, #a9ba9d);
    opacity: 0.5;
}
.mock-nav-item.active .mock-nav-icon { background: var(--m-accent, #d4e157); opacity: 1; }

.mock-nav-text {
    height: 8px;
    border-radius: 2px;
    background: var(--m-secondary, #a9ba9d);
    opacity: 0.4;
}
.mock-nav-item.active .mock-nav-text { background: var(--m-text, #f1f3ec); opacity: 0.8; }

.mock-main {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mock-page-title {
    width: 140px;
    height: 14px;
    border-radius: 3px;
    background: var(--m-text, #f1f3ec);
    opacity: 0.7;
}

.mock-cards-grid { display: flex; gap: 0.75rem; }

.mock-card {
    flex: 1;
    background: var(--m-surface, #242821);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    gap: 0.6rem;
}
.mock-card-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mock-card-icon-inner {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    background: var(--m-accent, #d4e157);
    opacity: 0.7;
}
.mock-card-lines { display: flex; flex-direction: column; gap: 4px; justify-content: center; }

.mock-card-line {
    height: 6px;
    border-radius: 2px;
    background: var(--m-secondary, #a9ba9d);
    opacity: 0.3;
}
.mock-card-line:first-child { width: 60px; }
.mock-card-line:last-child { width: 40px; opacity: 0.2; }

.mock-tool-area { display: flex; flex-direction: column; gap: 0.6rem; }

.mock-btn-row { display: flex; gap: 0.4rem; }

.mock-btn {
    height: 24px;
    width: 60px;
    border-radius: var(--radius-sm);
    background: var(--m-accent, #d4e157);
}
.mock-btn.secondary {
    background: var(--m-surface, #242821);
    border: 1px solid rgba(255,255,255,0.08);
    width: 50px;
}

.mock-textarea {
    background: var(--m-surface, #242821);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 80px;
}
.mock-text-line {
    height: 6px;
    border-radius: 2px;
    background: var(--m-secondary, #a9ba9d);
    opacity: 0.2;
    width: 90%;
}
.mock-text-line:nth-child(2) { width: 75%; }
.mock-text-line:nth-child(3) { width: 85%; }
.mock-text-line:nth-child(4) { width: 60%; }

.theme-export-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.theme-export-bar .css-preview {
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 700px) {
    .themes-layout { flex-direction: column; }
    .themes-subnav { width: 100%; flex-direction: row; padding: 0.5rem; }
    .themes-subnav-header { display: none; }
    .themes-subnav-item { border-left: none; border-bottom: 2px solid transparent; }
    .themes-subnav-item.active { border-bottom-color: var(--accent); }
    .themes-content { padding-left: 0; padding-top: 1rem; }
    .color-pickers-bar { justify-content: center; }
    .mock-sidebar { display: none; }
}
