/* ===== Otto Admin Theme ===== */
:root {
    /* Brand */
    --otto-brand-primary: black;
    --otto-brand-accent: #e5e7eb;

    /* Typography */
    --otto-font-family: 'Inter', sans-serif;
    --otto-font-size-xs: 11px;
    --otto-font-size-sm: 13px;
    --otto-font-size-base: 14px;
    --otto-font-weight-medium: 500;
    --otto-font-weight-semibold: 600;
    --otto-font-weight-bold: 700;
    --otto-line-height-xs: 15px;
    --otto-line-height-sm: 19px;
    --otto-line-height-base: 20px;

    /* Surface */
    --otto-surface-primary: black;
    --otto-surface-elevated: #1a1a1a;
    --otto-surface-hover: #333;

    /* Text */
    --otto-text-primary: #e5e7eb;
    --otto-text-on-surface: #e5e7eb;
    --otto-text-error: #e50000;

    /* Border */
    --otto-border-color: #e5e7eb;
    --otto-border-radius-sm: 4px;
    --otto-border-radius-md: 8px;

    /* Scrollbar. A mid grey rather than --otto-border-color: a border-coloured thumb disappears against
       any filled surface (--otto-surface-fill is only one step away from it). */
    --otto-scrollbar-thumb: #c9ccd1;
    --otto-scrollbar-thumb-hover: #9a9ea5;

    /* Topbar */
    --otto-topbar-height: 60px;
    --otto-topbar-bg: var(--otto-surface-primary);
    --otto-topbar-border: var(--otto-border-color);
    --otto-topbar-text: var(--otto-text-primary);

    /* Sidebar */
    --otto-sidebar-width: 224px;
    --otto-sidebar-width-collapsed: 64px;
    --otto-panel-collapse-duration: 200ms;
    --otto-sidebar-bg: white;
    --otto-sidebar-border: var(--otto-border-color);
    --otto-sidebar-text: #23303c;
    --otto-sidebar-text-secondary: #63666a;
    --otto-sidebar-text-muted: #9a9ea5;
    --otto-sidebar-hover-fill: #f3f4f6;
    --otto-sidebar-avatar-size: 36px;
    --otto-sidebar-icon-size: 16px;
    --otto-sidebar-radius: 30px;
    --otto-sidebar-card-radius: 10px;
    --otto-card-shadow: 0 2px 8px rgba(3, 7, 18, 0.06);

    /* Content area */
    --otto-content-bg: #e5e2dc;
    --otto-content-divider: #c9ccd1;
    --otto-card-bg: white;
    --otto-card-border: var(--otto-border-color);
    /* Hover for a card on a LIGHT surface. Not --otto-surface-hover: that one belongs to the dark-surface
       family (--otto-surface-primary / -elevated) and turns a white card near-black. */
    --otto-card-hover-bg: #fafbfc;
    --otto-card-hover-border: #c9ccd1;
    --otto-card-padding: 28px;
    --otto-card-radius: var(--otto-border-radius-sm);
    --otto-card-radius-lg: 16px;
    --otto-content-frame: clamp(16px, 2.6vw, 40px);
    --otto-content-padding-x: var(--otto-content-frame);
    --otto-content-padding-top: var(--otto-content-frame);
    --otto-content-padding-bottom: var(--otto-content-frame);

    /* Icons */
    --otto-icon-size-sm: 18px;
    --otto-icon-size-md: 20px;
    --otto-avatar-size: 32px;

    /* Form validation */
    --otto-color-success: #26b050;
    --otto-color-error: #e50000;

    /* Spacing */
    --otto-spacing-xs: 4px;
    --otto-spacing-sm: 6px;
    --otto-spacing-md: 8px;
    --otto-spacing-lg: 10px;
    --otto-spacing-xl: 16px;
    --otto-spacing-2xl: 20px;

    /* Colors (extended) */
    --otto-color-danger: #e04040;
    --otto-color-info: #42a6ef;
    --otto-color-warning: #b45309;

    /* Text on light backgrounds */
    --otto-text-heading: #374151;
    --otto-text-sub: #626569;
    --otto-text-dark: #111827;

    /* Banner surface/border/text. Not --otto-color-error / -success, which are accents. */
    --otto-feedback-error-bg: #fee2e2;
    --otto-feedback-error-border: #fca5a5;
    --otto-feedback-error-text: #991b1b;
    --otto-feedback-success-bg: #dcfce7;
    --otto-feedback-success-border: #86efac;
    --otto-feedback-success-text: #166534;
    --otto-feedback-warning-bg: #fef3c7;
    --otto-feedback-warning-border: #fcd34d;
    --otto-feedback-warning-text: #92400e;
    --otto-feedback-warning-bg-soft: #fffbeb;
    --otto-feedback-info-bg: #eff6ff;
    --otto-feedback-info-border: #bfdbfe;
    --otto-feedback-info-text: #1e40af;

    --otto-callout-bg: #f9fafb;

    /* Not --otto-btn-secondary-bg: that one is the dark button for filled surfaces. */
    --otto-btn-neutral-bg: #f3f4f6;
    --otto-btn-neutral-hover-bg: #e5e7eb;

    /* Buttons */
    --otto-btn-primary-bg: #111827;
    --otto-btn-primary-text: #ffffff;
    --otto-field-height: 48px;
    --otto-control-radius: 10px;
    --otto-card-elevation: 0 1px 2px rgba(17, 24, 39, .04), 0 14px 34px -10px rgba(17, 24, 39, .12);
    --otto-focus-ring: 0 0 0 4px rgba(16, 115, 187, .14);
    --otto-btn-muted-bg: #e5e7eb;
    --otto-btn-secondary-bg: #636872;
    --otto-btn-height: 36px;
    --otto-btn-font-size: var(--otto-font-size-base);
    --otto-btn-padding-x: 14px;

    /* Modal */
    --otto-overlay-bg: rgba(17, 24, 39, 0.7);

    /* Font sizes (extended) */
    --otto-font-size-2xs: 9px;
    --otto-font-size-md: 16px;
    --otto-font-size-lg: 22px;
    --otto-line-height-2xs: 12px;
    --otto-line-height-md: 24px;
    --otto-line-height-lg: 34px;

    /* Icon (extended) */
    --otto-icon-size-lg: 32px;

    /* The t-shirt scale has no slot between xs (11px) and sm (13px); these mirror the design
       system's own Font/Size/12px + Font/Line Height/17px tokens, used by table paging controls. */
    --otto-font-size-12: 12px;
    --otto-line-height-17: 17px;

    /* Neutral fill behind zebra table rows and secondary controls (design token "Fill"). */
    --otto-surface-fill: #f3f4f6;

    /* Focus ring */
    --otto-focus-color: #1073bb;

    /* Status surface tints consumed by Otto.Shared.Components. Same values as the tenant app's
       app.css so a shared component renders identically in both hosts. */
    --otto-color-success-bg-medium: rgba(38, 176, 80, 0.15);
    --otto-color-warning-bg-medium: rgba(245, 158, 11, 0.15);
    --otto-color-danger-bg-medium: rgba(224, 64, 64, 0.15);
    --otto-color-info-bg-medium: rgba(66, 166, 239, 0.15);
    --otto-color-neutral-bg-soft: rgba(229, 231, 235, 0.6);

    --otto-area-accent: var(--otto-surface-primary);
    --otto-area-accent-contrast: var(--otto-text-primary);
    --otto-area-accent-soft: var(--otto-sidebar-hover-fill);
    --otto-avatar-bg-on-light: var(--otto-brand-primary);
    --otto-avatar-fg-on-light: #ffffff;
    --otto-avatar-bg-on-dark: #ffffff;
    --otto-avatar-fg-on-dark: var(--otto-brand-primary);

    --otto-detail-panel-bg: #111827;
    --otto-detail-panel-text: #ffffff;
    --otto-detail-panel-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
    --otto-topbar-scrim: rgba(255, 255, 255, 0.08);
    --otto-topbar-hairline: rgba(255, 255, 255, 0.18);
    --otto-hairline: #eeeeee;
    --otto-text-quiet: #8a8d93;
    --otto-control-border: #e2e4e8;
    --otto-accent-soft-bg: #eaf3fb;
    --otto-savebar-muted: #d1d5db;
    --otto-flash-bg: #fff8db;
    --otto-color-danger-text: #b3261e;
}

[data-otto-area] {
    --otto-area-accent-contrast: var(--otto-brand-primary);
    --otto-topbar-scrim: rgba(0, 0, 0, 0.06);
    --otto-topbar-hairline: rgba(0, 0, 0, 0.22);
    --otto-avatar-bg-on-dark: var(--otto-brand-primary);
    --otto-avatar-fg-on-dark: #ffffff;
}

[data-otto-area="operator"] {
    --otto-area-accent: #42a6ef;
    --otto-area-accent-soft: rgba(66, 166, 239, 0.16);
}

[data-otto-area="manager"] {
    --otto-area-accent: #2ab245;
    --otto-area-accent-soft: rgba(42, 178, 69, 0.16);
}

.otto-area-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--otto-spacing-md);
    border-radius: 999px;
    background: var(--otto-topbar-scrim);
    border: 1px solid var(--otto-topbar-hairline);
    color: var(--otto-area-accent-contrast);
    font-size: var(--otto-font-size-xs);
    font-weight: var(--otto-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-base);
    line-height: var(--otto-line-height-base);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--otto-color-success);
}

.invalid {
    outline: 1px solid var(--otto-color-error);
}

.validation-message {
    color: var(--otto-color-error);
}

.dirty-indicator {
    margin-right: auto;
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-xs);
    color: var(--otto-feedback-warning-text);
    font-style: italic;
}
.config-tabs {
    display: flex;
    gap: var(--otto-spacing-xs);
    border-bottom: 1px solid var(--otto-card-border);
    margin-bottom: var(--otto-spacing-2xl);
}

.config-tab {
    padding: var(--otto-spacing-md) var(--otto-spacing-xl);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-sm);
    font-weight: var(--otto-font-weight-medium);
    color: var(--otto-text-sub);
    cursor: pointer;
    text-decoration: none;
}

.config-tab:hover {
    color: var(--otto-text-heading);
}

.config-tab-active {
    color: var(--otto-brand-primary);
    border-bottom-color: var(--otto-brand-primary);
    font-weight: var(--otto-font-weight-semibold);
    cursor: default;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Confined to the Platform card on purpose: the same class names exist on pages elsewhere
   in the portal that style them differently. */
.platform-card .form-section {
    margin-bottom: var(--otto-spacing-2xl);}
.platform-card .form-section-title {
    margin: 0 0 var(--otto-spacing-md) 0;
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-md);
    font-weight: var(--otto-font-weight-semibold);
    color: var(--otto-text-heading);}
.platform-card .form-error {
    background: var(--otto-feedback-error-bg);
    color: var(--otto-feedback-error-text);
    border: 1px solid var(--otto-feedback-error-border);
    border-radius: var(--otto-border-radius-sm);
    padding: var(--otto-spacing-lg) var(--otto-spacing-xl);
    margin-bottom: var(--otto-spacing-2xl);
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-sm);}
.platform-card .detail-success {
    background: var(--otto-feedback-success-bg);
    color: var(--otto-feedback-success-text);
    border: 1px solid var(--otto-feedback-success-border);
    border-radius: var(--otto-border-radius-sm);
    padding: var(--otto-spacing-lg) var(--otto-spacing-xl);
    margin-bottom: var(--otto-spacing-2xl);
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-sm);}
.form-card .form-actions,
.platform-card .form-actions,
.sticky-card-footer {
    position: sticky;
    bottom: calc(-1 * var(--otto-content-padding-bottom));
    z-index: 1;
    margin-left: calc(-1 * var(--otto-card-padding));
    margin-right: calc(-1 * var(--otto-card-padding));
    margin-bottom: calc(-1 * var(--otto-card-padding));
    padding: var(--otto-spacing-lg) var(--otto-card-padding);
    background: var(--otto-card-bg);
    border-top: 1px solid var(--otto-card-border);
    border-radius: 0 0 var(--otto-sidebar-card-radius) var(--otto-sidebar-card-radius);}
.form-card .form-actions,
.platform-card .form-actions {
    align-items: center;}
.platform-card .form-actions {
    display: flex;
    gap: var(--otto-spacing-md);
    justify-content: flex-end;
    margin-top: var(--otto-spacing-2xl);}
.platform-card {
    background: var(--otto-card-bg);
    border: 1px solid var(--otto-card-border);
    border-radius: var(--otto-sidebar-card-radius);
    padding: var(--otto-card-padding);
    max-width: 900px;
    border-left: 3px solid var(--otto-brand-primary);
}

.platform-card .btn-primary {
    padding: var(--otto-spacing-md) var(--otto-spacing-xl);
    background: var(--otto-btn-primary-bg);
    color: white;
    border: none;
    border-radius: var(--otto-border-radius-sm);
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-sm);
    font-weight: var(--otto-font-weight-semibold);
    cursor: pointer;}
.platform-card .btn-primary:hover:not(:disabled) {
    opacity: 0.9;}
.platform-card .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;}
.platform-card .btn-secondary {
    padding: var(--otto-spacing-md) var(--otto-spacing-xl);
    background: var(--otto-btn-neutral-bg);
    color: var(--otto-text-heading);
    border: none;
    border-radius: var(--otto-border-radius-sm);
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-sm);
    font-weight: var(--otto-font-weight-medium);
    cursor: pointer;}
.platform-card .btn-secondary:hover:not(:disabled) {
    background: var(--otto-btn-neutral-hover-bg);}
.platform-card .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;}
.platform-card .empty-state {
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-sm);
    color: var(--otto-text-sub);
    font-style: italic;}
.platform-card .callout {
    background: var(--otto-callout-bg);
    border: 1px solid var(--otto-card-border);
    border-radius: var(--otto-border-radius-sm);
    padding: var(--otto-spacing-lg) var(--otto-spacing-xl);
    margin-bottom: var(--otto-spacing-2xl);
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-sm);
    color: var(--otto-text-sub);}

.otto-sidebar-footer {
    border-top: 1px solid var(--otto-border-color);
    padding: var(--otto-spacing-md) 12px;}
.otto-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: var(--otto-spacing-lg);
    padding: var(--otto-spacing-md) var(--otto-spacing-2xl);
    border-radius: var(--otto-sidebar-radius);
    font-family: var(--otto-font-family);
    font-weight: var(--otto-font-weight-medium);
    font-size: var(--otto-font-size-sm);
    line-height: var(--otto-line-height-sm);
    color: var(--otto-sidebar-text-secondary);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    overflow: hidden;}
.otto-sidebar-toggle span {
    white-space: nowrap;}
.otto-sidebar-toggle:hover {
    background-color: var(--otto-sidebar-hover-fill);}
.otto-sidebar-toggle .otto-sidebar-toggle-icon {
    width: var(--otto-sidebar-icon-size);
    height: var(--otto-sidebar-icon-size);
    flex-shrink: 0;
    transition: transform var(--otto-panel-collapse-duration) ease;}
.collapsed .otto-sidebar-toggle {
    justify-content: center;
    padding: var(--otto-spacing-md);}
.collapsed .otto-sidebar-toggle span {
    display: none;}
.collapsed .otto-sidebar-toggle .otto-sidebar-toggle-icon {
    transform: rotate(180deg);}

.app-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: block;
    max-width: 320px;
    padding: var(--otto-spacing-md) var(--otto-spacing-lg);
    background-color: var(--otto-detail-panel-bg);
    color: var(--otto-detail-panel-text);
    border-radius: 8px;
    box-shadow: var(--otto-detail-panel-shadow);
    font-family: var(--otto-font-family);
    font-size: var(--otto-font-size-sm);
    font-weight: 400;
    line-height: var(--otto-line-height-sm);
    overflow-wrap: anywhere;
    pointer-events: none;
}

.app-tooltip[hidden] {
    display: none;
}

.tw-head { margin-bottom: 24px; }
.tw-back { color: var(--otto-text-quiet); text-decoration: none; font-size: var(--otto-font-size-sm); }
.tw-back::before { content: "‹ "; }
.tw-back:hover { color: var(--otto-text-dark); }
.tw-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--otto-spacing-xl); margin-top: var(--otto-spacing-sm); }
.tw-title { margin: 0; font-size: var(--otto-font-size-lg); line-height: var(--otto-line-height-lg); font-weight: var(--otto-font-weight-semibold); color: var(--otto-text-dark); }
.tw-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: var(--otto-spacing-xs); color: var(--otto-text-sub); font-size: var(--otto-font-size-sm); }
.tw-sep { margin: 0 var(--otto-spacing-md); color: var(--otto-content-divider); }
.tw-stats { display: flex; flex-wrap: wrap; gap: 24px; margin-top: var(--otto-spacing-lg); font-size: var(--otto-font-size-sm); color: var(--otto-text-heading); }
.tw-stat { display: inline-flex; align-items: center; gap: var(--otto-spacing-md); }
.tw-head-notice { margin-bottom: var(--otto-spacing-xl); }
.tw-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.tw-quiet { color: var(--otto-text-quiet); }
.tw-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--otto-spacing-lg); }
.tw-right { text-align: right; }
.tw-plain { padding-top: 7px; color: var(--otto-text-heading); }

.tw-menu-wrap { position: relative; }
.tw-icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--otto-border-radius-md); background: transparent; color: var(--otto-text-sub); cursor: pointer; }
.tw-icon-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--otto-text-dark); }
.tw-icon-btn svg { width: 18px; height: 18px; }
.tw-menu-backdrop { position: fixed; inset: 0; z-index: 39; }
.tw-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; padding: var(--otto-spacing-sm); background: var(--otto-card-bg); border-radius: var(--otto-control-radius); box-shadow: var(--otto-card-elevation); }
.tw-menu button { display: block; width: 100%; padding: var(--otto-spacing-md) var(--otto-spacing-lg); border: 0; border-radius: var(--otto-border-radius-sm); background: none; text-align: left; font: inherit; color: var(--otto-text-heading); cursor: pointer; }
.tw-menu button:hover { background: var(--otto-surface-fill); }
.tw-menu hr { margin: var(--otto-spacing-sm) 0; border: 0; border-top: 1px solid var(--otto-hairline); }
.tw-menu .tw-menu-danger { color: var(--otto-color-danger-text); }

.tw-body { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 36px; align-items: start; }
.tw-nav { position: sticky; top: 80px; display: flex; flex-direction: column; }
.tw-nav-link { display: flex; align-items: center; justify-content: space-between; gap: var(--otto-spacing-md); margin-left: calc(-1 * var(--otto-spacing-lg)); padding: var(--otto-spacing-sm) var(--otto-spacing-lg); border-radius: var(--otto-border-radius-sm); color: var(--otto-text-sub); text-decoration: none; }
.tw-nav-link:hover { color: var(--otto-text-dark); }
.tw-nav-link-active { background: rgba(255, 255, 255, 0.6); color: var(--otto-text-dark); font-weight: var(--otto-font-weight-semibold); }
.tw-nav-count { font-size: var(--otto-font-size-xs); color: var(--otto-text-quiet); }
.tw-nav-sep { height: 1px; margin: var(--otto-spacing-lg) 0; background: rgba(0, 0, 0, 0.07); }

.tw-content { display: flex; flex-direction: column; gap: var(--otto-spacing-xl); min-width: 0; padding-bottom: 96px; }
.tw-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--otto-spacing-xl); }
.tw-section-title { margin: 0; font-size: var(--otto-font-size-md); font-weight: var(--otto-font-weight-semibold); color: var(--otto-text-dark); }
.tw-section-desc { margin: 2px 0 0; font-size: var(--otto-font-size-sm); color: var(--otto-text-sub); }

.tw-card { background: var(--otto-card-bg); border-radius: var(--otto-card-radius-lg); overflow: hidden; }
.tw-card-title { margin: 0; padding: var(--otto-spacing-xl) 20px 0; font-size: var(--otto-font-size-12); font-weight: var(--otto-font-weight-semibold); letter-spacing: 0.05em; text-transform: uppercase; color: var(--otto-text-quiet); }
.tw-card-pad { padding: var(--otto-spacing-xl) 20px 0; margin: 0; }
.tw-part-notice { padding: var(--otto-spacing-xl) 20px 0; }
.tw-blank { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 28px 20px; }
.tw-blank p { margin: 0; }

.tw-setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; padding: var(--otto-spacing-xl) 20px; border-top: 1px solid var(--otto-hairline); }
.tw-card > .tw-setting:first-child, .tw-card > .tw-card-title + .tw-setting, .tw-card > .tw-card-pad + .tw-setting { border-top: 0; }
.tw-setting-wide { grid-template-columns: 1fr; gap: var(--otto-spacing-lg); }
.tw-setting-label { display: flex; flex-wrap: wrap; align-items: center; gap: var(--otto-spacing-md); padding-top: 7px; font-weight: var(--otto-font-weight-medium); color: var(--otto-text-dark); }
.tw-setting-label label { cursor: pointer; }
.tw-setting-hint { margin-top: 2px; font-size: var(--otto-font-size-sm); color: var(--otto-text-quiet); }
.tw-setting-off .tw-setting-label { color: var(--otto-text-quiet); }
.tw-setting-control { display: flex; flex-direction: column; gap: var(--otto-spacing-md); min-width: 0; }
.tw-setting-status { display: flex; align-items: center; gap: var(--otto-spacing-lg); font-size: var(--otto-font-size-sm); }
.tw-custom-tag { padding: 1px 6px; border-radius: var(--otto-border-radius-sm); background: var(--otto-accent-soft-bg); font-size: var(--otto-font-size-xs); font-weight: var(--otto-font-weight-medium); color: var(--otto-focus-color); }
.tw-owner-tag { padding: 1px 6px; border-radius: var(--otto-border-radius-sm); background: var(--otto-surface-fill); font-size: var(--otto-font-size-xs); font-weight: var(--otto-font-weight-medium); color: var(--otto-text-sub); }
.tw-pill-origin { padding: 1px 8px; border-radius: 999px; background: var(--otto-feedback-info-bg); font-size: var(--otto-font-size-xs); font-weight: var(--otto-font-weight-medium); color: var(--otto-feedback-info-text); white-space: nowrap; }
.tw-pill-pending { margin-left: var(--otto-spacing-md); padding: 1px 7px; border-radius: 999px; background: var(--otto-feedback-warning-bg); font-size: var(--otto-font-size-xs); font-weight: var(--otto-font-weight-medium); color: var(--otto-feedback-warning-text); }
.tw-control-hint { font-size: var(--otto-font-size-sm); color: var(--otto-text-quiet); }
.tw-field-error { font-size: var(--otto-font-size-sm); color: var(--otto-color-danger-text); }
.tw-warn-text { color: var(--otto-color-warning); }
.tw-over { font-weight: var(--otto-font-weight-medium); color: var(--otto-color-danger-text); }

.tw-input, .tw-select, .tw-textarea { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--otto-control-border); border-radius: var(--otto-border-radius-md); background: var(--otto-card-bg); font: inherit; color: var(--otto-text-dark); }
.tw-textarea { height: auto; padding: var(--otto-spacing-md) 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; resize: vertical; }
.tw-input:focus, .tw-select:focus, .tw-textarea:focus { outline: none; border-color: var(--otto-focus-color); box-shadow: var(--otto-focus-ring); }
.tw-input::placeholder, .tw-textarea::placeholder { color: #a9acb1; }
.tw-input:disabled { background: var(--otto-surface-fill); cursor: not-allowed; }
.tw-input-num { width: 120px; }
.tw-input-search { max-width: 300px; }
.tw-select-auto { width: auto; min-width: 180px; }

.tw-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--otto-control-border); border-radius: var(--otto-border-radius-md); background: var(--otto-card-bg); font: inherit; font-weight: var(--otto-font-weight-medium); color: var(--otto-text-dark); text-decoration: none; white-space: nowrap; cursor: pointer; }
.tw-btn:hover:not(:disabled) { background: var(--otto-surface-fill); }
.tw-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tw-btn-primary { border-color: var(--otto-btn-primary-bg); background: var(--otto-btn-primary-bg); color: var(--otto-btn-primary-text); }
.tw-btn-primary:hover:not(:disabled) { background: #000; }
.tw-btn-warning { color: var(--otto-feedback-warning-text); }
.tw-btn-danger-quiet { color: var(--otto-color-danger-text); }
.tw-link { padding: 0; border: 0; background: none; font: inherit; font-size: var(--otto-font-size-sm); color: var(--otto-text-sub); cursor: pointer; }
.tw-link:hover:not(:disabled) { color: var(--otto-text-dark); text-decoration: underline; }
.tw-link:disabled { opacity: 0.45; cursor: not-allowed; }
.tw-link-danger { color: var(--otto-color-danger-text); }
.tw-link-accent { color: var(--otto-focus-color); }

.tw-segmented { display: inline-flex; flex-wrap: wrap; align-self: flex-start; gap: 2px; padding: 3px; border-radius: var(--otto-border-radius-md); background: var(--otto-surface-fill); }
.tw-segmented label { position: relative; padding: 5px 12px; border-radius: var(--otto-border-radius-sm); font-size: var(--otto-font-size-sm); font-weight: var(--otto-font-weight-medium); color: var(--otto-text-sub); cursor: pointer; }
.tw-segmented label.tw-on { background: var(--otto-card-bg); color: var(--otto-text-dark); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.tw-segmented label:focus-within { box-shadow: var(--otto-focus-ring); }
.tw-segmented input { position: absolute; inset: 0; margin: 0; opacity: 0; pointer-events: none; }

.tw-switch { display: inline-flex; align-self: flex-start; padding-top: var(--otto-spacing-sm); cursor: pointer; }
.tw-switch input { position: relative; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: #d6d8dc; appearance: none; cursor: pointer; transition: background 0.15s; }
.tw-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.tw-switch input:checked { background: var(--otto-text-dark); }
.tw-switch input:checked::after { left: 16px; }
.tw-switch input:disabled { opacity: 0.45; cursor: not-allowed; }
.tw-switch input:focus-visible { box-shadow: var(--otto-focus-ring); outline: none; }

.tw-checks { display: flex; flex-direction: column; gap: var(--otto-spacing-md); padding-top: var(--otto-spacing-sm); }
.tw-check { display: inline-flex; align-items: center; gap: var(--otto-spacing-md); cursor: pointer; }
.tw-check input { margin: 0; accent-color: var(--otto-text-dark); }
.tw-tags { display: flex; flex-wrap: wrap; gap: var(--otto-spacing-sm); }
.tw-tag { padding: 2px var(--otto-spacing-md); border-radius: var(--otto-border-radius-sm); background: var(--otto-surface-fill); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--otto-font-size-12); color: var(--otto-text-heading); }
.tw-tag-off { border: 1px dashed #dcdee2; background: transparent; color: #b5b8bd; }

.tw-notice { padding: var(--otto-spacing-lg) 14px; border-radius: var(--otto-control-radius); font-size: var(--otto-font-size-sm); }
.tw-notice p { margin: 0; }
.tw-notice-list { margin: var(--otto-spacing-sm) 0; padding-left: 18px; }
.tw-notice-warn { background: var(--otto-feedback-warning-bg); color: var(--otto-feedback-warning-text); }
.tw-notice-danger { background: var(--otto-feedback-error-bg); color: var(--otto-feedback-error-text); }
.tw-notice-success { background: var(--otto-feedback-success-bg); color: var(--otto-feedback-success-text); }

.tw-gauge { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: rgba(0, 0, 0, 0.07); }
.tw-gauge > span { display: block; height: 100%; border-radius: 3px; background: var(--otto-text-dark); }
.tw-gauge.tw-gauge-near > span { background: var(--otto-color-warning); }
.tw-gauge.tw-gauge-over > span { background: var(--otto-color-danger); }
.tw-gauge-mini { width: 80px; height: 4px; }

.tw-usage { display: flex; flex-direction: column; gap: 12px; padding: 22px 20px 20px; }
.tw-usage p { margin: 0; }
.tw-usage-figure { display: flex; align-items: baseline; gap: var(--otto-spacing-xs); font-size: 30px; font-weight: var(--otto-font-weight-semibold); letter-spacing: -0.02em; color: var(--otto-text-dark); }
.tw-usage-figure span { font-weight: var(--otto-font-weight-medium); color: var(--otto-text-quiet); }
.tw-usage-figure small { margin-left: var(--otto-spacing-md); font-size: var(--otto-font-size-sm); font-weight: 400; letter-spacing: 0; color: var(--otto-text-quiet); }
.tw-usage-line { font-size: var(--otto-font-size-sm); color: var(--otto-text-sub); }

.tw-action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--otto-hairline); }
.tw-card > .tw-action-row:first-child { border-top: 0; }
.tw-action-row .tw-setting-label { padding-top: 0; }
.tw-row-actions { display: flex; align-items: center; gap: 18px; }

.tw-savebar { position: fixed; bottom: 20px; left: 50%; z-index: 50; display: flex; align-items: center; gap: 12px; padding: var(--otto-spacing-md) var(--otto-spacing-md) var(--otto-spacing-md) 18px; transform: translateX(-50%); border-radius: 12px; background: var(--otto-btn-primary-bg); box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4); font-size: var(--otto-font-size-sm); color: #fff; }
.tw-savebar .dirty-indicator { color: #fff; }
.tw-savebar-error { color: #fca5a5; }
.tw-savebar-warning { background: var(--otto-feedback-warning-bg); color: var(--otto-feedback-warning-text); }
.tw-savebar-warning:hover { filter: brightness(0.95); }
.tw-notice:focus { outline: none; }
.tw-notice:focus-visible { box-shadow: var(--otto-focus-ring); outline: 2px solid var(--otto-focus-color); outline-offset: 2px; }
.tw-savebar button { height: 30px; padding: 0 12px; border: 0; border-radius: var(--otto-border-radius-md); font: inherit; font-weight: var(--otto-font-weight-medium); cursor: pointer; }
.tw-savebar-discard { background: transparent; color: var(--otto-savebar-muted); }
.tw-savebar-discard:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: #fff; }
.tw-savebar-save { background: #fff; color: var(--otto-btn-primary-bg); }
.tw-savebar-save:hover:not(:disabled) { background: var(--otto-border-color); }
.tw-savebar button:disabled { opacity: 0.5; cursor: not-allowed; }
.tw-toast { position: fixed; bottom: 76px; left: 50%; z-index: 51; padding: var(--otto-spacing-md) 14px; transform: translateX(-50%); border-radius: var(--otto-border-radius-md); background: var(--otto-btn-primary-bg); font-size: var(--otto-font-size-sm); color: #fff; }

.tw-page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--otto-spacing-xl); margin-bottom: 14px; }
.tw-filters { display: flex; gap: 2px; }
.tw-filter { padding: var(--otto-spacing-sm) 12px; border: 0; border-radius: var(--otto-border-radius-md); background: none; font: inherit; font-weight: var(--otto-font-weight-medium); color: var(--otto-text-sub); cursor: pointer; }
.tw-filter:hover { color: var(--otto-text-dark); }
.tw-filter.tw-on { background: var(--otto-card-bg); color: var(--otto-text-dark); }
.tw-list-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 130px 120px 240px; gap: var(--otto-spacing-xl); align-items: center; padding: 14px 20px; border-top: 1px solid var(--otto-hairline); color: inherit; text-decoration: none; }
.tw-list-row:first-child { border-top: 0; }
a.tw-list-row:hover { background: var(--otto-card-hover-bg); }
.tw-list-head { padding-top: var(--otto-spacing-lg); padding-bottom: var(--otto-spacing-lg); font-size: var(--otto-font-size-12); font-weight: var(--otto-font-weight-semibold); letter-spacing: 0.05em; text-transform: uppercase; color: var(--otto-text-quiet); }
.tw-list-main { display: flex; align-items: baseline; gap: var(--otto-spacing-lg); min-width: 0; }
.tw-list-name { font-weight: var(--otto-font-weight-semibold); color: var(--otto-text-dark); }
.tw-list-words { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--otto-spacing-md); font-size: var(--otto-font-size-sm); }

@media (max-width: 1000px) {
    .tw-body { grid-template-columns: 1fr; gap: var(--otto-spacing-xl); }
    .tw-nav { position: static; flex-flow: row wrap; gap: var(--otto-spacing-xs) 12px; }
    .tw-nav-sep { display: none; }
    .tw-nav-link { margin-left: 0; }
    .tw-setting { grid-template-columns: 1fr; gap: var(--otto-spacing-md); }
    .tw-setting-label { padding-top: 0; }
    .tw-list-row { grid-template-columns: minmax(0, 1fr) auto; }
    .tw-list-row > :nth-child(2), .tw-list-row > :nth-child(3), .tw-list-row > :nth-child(4), .tw-list-row > :nth-child(5) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .otto-sidebar-toggle .otto-sidebar-toggle-icon,
    .tw-switch input,
    .tw-switch input::after {
        transition: none;
    }
}
