/* ============================================================
   currently-mobile-web — mobile-first stylesheet
   True mobile-app shell: sticky header + bottom-nav, only the
   middle <main> scrolls. Currently dashboard dark palette.
   ============================================================ */

:root {
    /* Brand accent — overridden per-tenant by branding.js. Default = Currently orange */
    --web-primary: #F5A623;
    --web-primary-hover: #EA940B;
    --web-secondary: #1E40AF;

    /* Currently dashboard dark palette */
    --web-bg: #1A1A1A;
    --web-bg-deep: #0D0D0D;
    --web-surface: #1C1C1C;
    --web-card-bg: rgba(255, 255, 255, 0.04);
    --web-card-hover: rgba(255, 255, 255, 0.06);
    --web-input-bg: #2A2A2A;
    --web-text: #FFFFFF;
    --web-text-body: #E6E6E6;
    --web-text-muted: rgba(255, 255, 255, 0.55);
    --web-text-placeholder: rgba(255, 255, 255, 0.35);
    --web-border: rgba(255, 255, 255, 0.08);
    --web-border-strong: #3A3A3A;

    /* Static tokens */
    --web-radius: 14px;
    --web-radius-sm: 10px;
    --web-radius-lg: 20px;
    --web-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --web-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --web-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --web-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --web-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

    --web-success: #10B981;
    --web-error: #EF4444;
    --web-warning: #F59E0B;
    --web-info: #3B82F6;

    /* Layout — mobile-first, content-readable on desktop without phone-frame */
    --web-nav-height: 68px;
    --web-header-height: 56px;
    --web-screen-padding: 16px;
    --web-content-max: 720px;
}

/* ----- Reset ----- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--web-font);
    background-color: var(--web-bg-deep);
    color: var(--web-text);
    line-height: 1.5;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

a {
    color: var(--web-primary);
    text-decoration: none;
    transition: color var(--web-transition);
}

h1, h2, h3, h4 {
    line-height: 1.25;
    font-weight: 600;
    color: var(--web-text);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-size: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ----- Root app shell — flex column, only <main> scrolls ----- */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* dynamic viewport — fixes iOS address-bar quirks */
    width: 100%;
    background: var(--web-bg);
    overflow: hidden;
    position: relative;
}

/* Helper: any direct shell-section gets edge-to-edge background but caps its
   inner content to --web-content-max so reading stays comfortable on desktop.
   Mobile (viewport ≤ 720px) → padding collapses to 16px = full-bleed. */
.web-header,
.web-nav,
.web-main {
    --gutter: max(16px, calc((100% - var(--web-content-max)) / 2));
}

.web-header {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.web-nav {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.web-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ----- Header (sticky inside #app) ----- */
.web-header {
    flex-shrink: 0;
    height: calc(var(--web-header-height) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: var(--web-bg);
    border-bottom: 1px solid var(--web-border);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    z-index: 50;
    position: relative;
}

.web-header-left {
    display: flex;
    align-items: center;
    min-width: 40px;
}

.web-header-logo {
    height: 30px;
    max-width: 120px;
    width: auto;
    object-fit: contain;
}

.web-header-title {
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.web-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.web-header-lang {
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 3px;
}

.web-header-lang button {
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--web-text-muted);
    transition: background var(--web-transition), color var(--web-transition);
    min-height: 26px;
}

.web-header-lang button.active {
    background: var(--web-bg);
    color: var(--web-text);
}

.web-header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--web-text-muted);
    transition: background-color var(--web-transition), color var(--web-transition);
    flex-shrink: 0;
}

.web-header-icon-btn:hover,
.web-header-icon-btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--web-text);
}

.web-header-icon-btn .material-symbols-outlined {
    font-size: 22px;
}

/* ----- Bottom nav (sticky inside #app) ----- */
.web-nav {
    flex-shrink: 0;
    height: calc(var(--web-nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--web-bg);
    border-top: 1px solid var(--web-border);
    display: flex;
    z-index: 100;
}

.web-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--web-text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    transition: color var(--web-transition);
    padding: 8px 4px;
    min-height: 44px;
}

.web-nav-item.active {
    color: var(--web-primary);
}

.web-nav-item .material-symbols-outlined {
    font-size: 26px;
}

/* ----- Screen container (within scrollable main) ----- */
.web-screen {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    padding-top: var(--web-screen-padding);
    padding-bottom: calc(var(--web-screen-padding) + 80px); /* leave room for FAB */
}

.web-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
    word-break: break-word;
}

/* ----- Generic states ----- */
.web-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    color: var(--web-text-muted);
    font-size: 0.95rem;
}

.web-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px 24px;
    color: var(--web-text-muted);
}

.web-empty .material-symbols-outlined {
    font-size: 56px;
    margin-bottom: 14px;
    opacity: 0.35;
}

.web-empty p {
    font-size: 1rem;
    margin-bottom: 4px;
}

.web-empty-hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

.web-text-hint {
    text-align: center;
    color: var(--web-text-muted);
    font-size: 0.82rem;
    margin-top: 24px;
    padding: 0 16px;
}

.web-text-muted {
    color: var(--web-text-muted);
}

.web-error-banner {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    padding: 14px 16px;
    border-radius: var(--web-radius-sm);
    font-size: 0.9rem;
    margin: 12px 0;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ----- Buttons (mobile-friendly tap targets) ----- */
.web-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: var(--web-radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color var(--web-transition), transform var(--web-transition), opacity var(--web-transition), filter var(--web-transition);
    min-height: 52px;
    user-select: none;
    -webkit-user-select: none;
    line-height: 1;
}

.web-btn:active {
    transform: scale(0.98);
}

.web-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.web-btn-primary {
    background: var(--web-primary);
    color: #fff;
}

.web-btn-primary:hover {
    filter: brightness(1.1);
}

.web-btn-secondary {
    background: var(--web-card-bg);
    color: var(--web-text);
    border: 1px solid var(--web-border);
}

.web-btn-secondary:hover {
    background: var(--web-card-hover);
}

.web-btn-text {
    background: transparent;
    color: var(--web-primary);
    padding: 10px 14px;
    min-height: 44px;
}

.web-btn-block {
    width: 100%;
}

/* ----- Inputs ----- */
.web-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.web-input-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--web-text-muted);
}

.web-input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--web-border);
    border-radius: var(--web-radius);
    background: var(--web-input-bg);
    color: var(--web-text);
    font-size: 16px; /* prevents iOS zoom-on-focus */
    transition: border-color var(--web-transition), box-shadow var(--web-transition);
    min-height: 52px;
}

.web-input:focus {
    outline: none;
    border-color: var(--web-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--web-primary) 25%, transparent);
}

.web-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
}

.web-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--web-primary);
    cursor: pointer;
}

/* ----- Cards ----- */
.web-card {
    background: var(--web-card-bg);
    border-radius: var(--web-radius);
    padding: 18px;
    margin-bottom: 14px;
    border: 1px solid var(--web-border);
}

/* ----- Login screens (no shell — own layout) ----- */
.web-login-page {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    position: relative;
}

.web-login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    padding: 32px 24px;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
    min-height: 100%;
}

.web-login-logo {
    max-width: 160px;
    max-height: 80px;
    margin: 0 auto 20px;
    object-fit: contain;
}

.web-login-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.web-login-subtitle {
    text-align: center;
    color: var(--web-text-muted);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.web-login-form {
    display: flex;
    flex-direction: column;
}

.web-login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--web-text-muted);
}

.web-login-link a {
    cursor: pointer;
    text-decoration: underline;
}

/* Lang switcher used on login screens (absolute-positioned) */
.web-lang-switcher {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 14px);
    right: calc(env(safe-area-inset-right) + 14px);
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
    border-radius: 999px;
    z-index: 10;
}

.web-lang-btn {
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--web-text-muted);
    transition: background var(--web-transition), color var(--web-transition);
    min-height: 30px;
}

.web-lang-btn.active {
    background: var(--web-bg);
    color: var(--web-text);
}

/* ----- Profile rows ----- */
.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--web-border);
    gap: 12px;
}

.profile-row:first-child {
    padding-top: 4px;
}

.profile-row:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.profile-row-label {
    font-size: 0.88rem;
    color: var(--web-text-muted);
    flex-shrink: 0;
}

.profile-row-value {
    font-size: 0.95rem;
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ----- Filter chips ----- */
.web-chip-row {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
}

.web-chip-row::-webkit-scrollbar { display: none; }

.web-chip {
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--web-text-muted);
    background: var(--web-card-bg);
    border: 1px solid var(--web-border);
    transition: all var(--web-transition);
    flex-shrink: 0;
    min-height: 40px;
}

.web-chip.active {
    color: #fff;
    background: var(--web-primary);
    border-color: var(--web-primary);
}

/* ----- Schedule ----- */
.schedule-day {
    margin-bottom: 24px;
}

.schedule-day-header {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--web-text-muted);
    margin-bottom: 10px;
    padding: 0 4px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px 16px 18px;
    background: var(--web-card-bg);
    border: 1px solid var(--web-border);
    border-radius: var(--web-radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform var(--web-transition), background var(--web-transition);
    position: relative;
    overflow: hidden;
    min-height: 72px;
}

.schedule-item:active {
    transform: scale(0.99);
    background: var(--web-card-hover);
}

.schedule-item-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.schedule-item-time {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 84px;
    flex-shrink: 0;
    color: var(--web-text);
    line-height: 1.3;
}

.schedule-item-body {
    flex: 1;
    min-width: 0;
}

.schedule-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.schedule-item-meta {
    font-size: 0.84rem;
    color: var(--web-text-muted);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.schedule-item-chevron {
    color: var(--web-text-muted);
    font-size: 22px;
    flex-shrink: 0;
    opacity: 0.6;
}

/* ----- Appointment detail ----- */
.apt-detail-time,
.apt-detail-row {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--web-border);
    align-items: flex-start;
}

.apt-detail-time:first-child,
.apt-detail-row:first-child {
    padding-top: 0;
}

.apt-detail-row:last-child,
.apt-detail-time + .apt-detail-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.apt-detail-time .material-symbols-outlined,
.apt-detail-row .material-symbols-outlined {
    color: var(--web-primary);
    flex-shrink: 0;
    font-size: 22px;
    margin-top: 1px;
}

.apt-action-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

/* ----- Project list ----- */
.project-card {
    background: var(--web-card-bg);
    border: 1px solid var(--web-border);
    border-radius: var(--web-radius);
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform var(--web-transition), background var(--web-transition);
}

.project-card:active {
    transform: scale(0.99);
    background: var(--web-card-hover);
}

.project-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.project-card-title {
    font-size: 1.02rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.project-card-meta {
    font-size: 0.84rem;
    color: var(--web-text-muted);
    margin: 3px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-num {
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    opacity: 0.7;
}

.project-card-date {
    margin-top: 8px;
    font-weight: 500;
    color: var(--web-text);
}

.project-card-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.project-status-design     { background: rgba(148,163,184,0.15); color: #94A3B8; }
.project-status-quoted     { background: rgba(245,158,11,0.18); color: #FBBF24; }
.project-status-accepted   { background: rgba(16,185,129,0.18); color: #34D399; }
.project-status-scheduled  { background: rgba(59,130,246,0.18); color: #60A5FA; }
.project-status-installing { background: rgba(168,85,247,0.18); color: #C4B5FD; }
.project-status-completed  { background: rgba(34,197,94,0.18); color: #6EE7B7; }
.project-status-archived   { background: rgba(148,163,184,0.15); color: #94A3B8; }

/* ----- Project detail ----- */
.project-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 0 4px;
}

.project-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--web-border);
    margin-bottom: 18px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
}

.project-tabs::-webkit-scrollbar { display: none; }

.project-tab {
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--web-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--web-transition), border-color var(--web-transition);
    flex-shrink: 0;
    min-height: 44px;
}

.project-tab.active {
    color: var(--web-primary);
    border-bottom-color: var(--web-primary);
}

/* ----- Notes ----- */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 0;
}

.note-card {
    background: var(--web-card-bg);
    border: 1px solid var(--web-border);
    border-radius: var(--web-radius);
    padding: 14px 16px;
    position: relative;
}

.note-pinned {
    border-left: 3px solid var(--web-primary);
}

.note-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--web-text-muted);
    margin-bottom: 6px;
}

.note-author {
    font-weight: 600;
    color: var(--web-text);
}

.note-date {
    margin-left: auto;
}

.note-content {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-card-action {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 8px;
    border-radius: 50%;
    color: var(--web-text-muted);
    transition: background-color var(--web-transition), color var(--web-transition);
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-card-action:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--web-error);
}

/* ----- Floating Action Button ----- */
.web-fab {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: calc(var(--web-nav-height) + env(safe-area-inset-bottom) + 20px);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--web-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--web-shadow-lg);
    z-index: 90;
    transition: transform var(--web-transition);
}

.web-fab:active {
    transform: scale(0.94);
}

.web-fab .material-symbols-outlined {
    font-size: 30px;
}

@media (min-width: 720px) {
    .web-fab {
        right: max(20px, calc((100vw - var(--web-content-max)) / 2 + 20px));
    }
}

/* ----- Bottom sheet ----- */
.web-bottom-sheet {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.web-bottom-sheet-content {
    width: 100%;
    max-width: var(--web-content-max);
    background: var(--web-bg);
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    box-shadow: var(--web-shadow-lg);
    animation: web-sheet-up 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes web-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.bottom-sheet-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* ----- Files grid ----- */
.files-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.files-grid-item {
    aspect-ratio: 1 / 1;
    background: var(--web-card-bg);
    border-radius: var(--web-radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--web-transition);
}

.files-grid-item:active {
    transform: scale(0.96);
}

.files-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ----- Files list ----- */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.files-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--web-card-bg);
    border: 1px solid var(--web-border);
    border-radius: var(--web-radius-sm);
    cursor: pointer;
    min-height: 64px;
}

.files-row-icon .material-symbols-outlined {
    color: var(--web-primary);
    font-size: 26px;
}

.files-row-body {
    flex: 1;
    min-width: 0;
}

.files-row-name {
    font-size: 0.95rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.files-row-meta {
    font-size: 0.8rem;
    color: var(--web-text-muted);
    margin-top: 3px;
}

.files-row-action {
    padding: 8px;
    color: var(--web-text-muted);
    border-radius: 50%;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.files-row-action:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--web-text);
}

#file-viewer {
    align-items: center;
    background: rgba(0, 0, 0, 0.94);
}

.files-viewer-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.files-viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.files-viewer-close {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ----- License-required ----- */
.license-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    color: var(--web-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px auto 24px;
}

.license-icon-wrap .material-symbols-outlined {
    font-size: 40px;
}

/* ----- Toast ----- */
.web-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--web-nav-height) + env(safe-area-inset-bottom) + 20px);
    padding: 14px 22px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--web-text);
    color: var(--web-bg);
    box-shadow: var(--web-shadow-lg);
    z-index: 1000;
    max-width: calc(100vw - 32px);
    text-align: center;
}

.web-toast-error {
    background: var(--web-error);
    color: #fff;
}

.web-toast-success {
    background: var(--web-success);
    color: #fff;
}

/* ----- Mobile sizing — tuned ~12% smaller after Wouter's "klein tikkeltje kleiner" ----- */
@media (max-width: 600px) {
    :root {
        --web-screen-padding: 16px;
        --web-nav-height: 64px;
        --web-header-height: 60px;
    }

    /* Header */
    .web-header {
        padding-top: calc(env(safe-area-inset-top) + 4px);
        height: calc(var(--web-header-height) + env(safe-area-inset-top) + 4px);
    }

    .web-header-logo {
        height: 38px;
        max-width: 160px;
    }

    .web-header-title {
        font-size: 1.02rem;
    }

    .web-header-icon-btn {
        width: 40px;
        height: 40px;
    }

    .web-header-icon-btn .material-symbols-outlined {
        font-size: 22px;
    }

    .web-header-lang button {
        padding: 6px 12px;
        font-size: 0.78rem;
        min-height: 30px;
    }

    /* Buttons */
    .web-btn {
        min-height: 50px;
        padding: 14px 20px;
        font-size: 0.98rem;
    }

    .web-btn .material-symbols-outlined {
        font-size: 20px;
    }

    /* Filter chips */
    .web-chip {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 40px;
    }

    .web-chip-row {
        gap: 8px;
        margin-bottom: 20px;
    }

    /* Schedule cards */
    .schedule-item {
        min-height: 78px;
        padding: 16px 14px 16px 20px;
        margin-bottom: 10px;
    }

    .schedule-item-time {
        font-size: 0.94rem;
        min-width: 86px;
    }

    .schedule-item-title {
        font-size: 1.02rem;
    }

    .schedule-item-meta {
        font-size: 0.86rem;
    }

    .schedule-item-chevron {
        font-size: 24px;
    }

    .schedule-day-header {
        font-size: 0.86rem;
        margin-bottom: 10px;
    }

    /* Project cards */
    .project-card {
        padding: 16px;
        margin-bottom: 10px;
    }

    .project-card-title {
        font-size: 1.02rem;
    }

    .project-card-meta {
        font-size: 0.86rem;
    }

    /* Project tabs */
    .project-tab {
        padding: 11px 14px;
        font-size: 0.94rem;
        min-height: 44px;
    }

    /* Generic cards */
    .web-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    /* Page titles */
    .web-page-title {
        font-size: 1.35rem;
        margin-bottom: 12px;
    }

    /* Bottom nav — slightly more compact */
    .web-nav-item {
        gap: 3px;
        font-size: 0.68rem;
        padding: 8px 4px;
    }

    .web-nav-item .material-symbols-outlined {
        font-size: 22px;
    }

    /* Inputs */
    .web-input {
        min-height: 50px;
        font-size: 0.96rem;
    }

    /* Profile rows */
    .profile-row-label {
        font-size: 0.86rem;
    }

    .profile-row-value {
        font-size: 0.96rem;
    }

    /* Login screens */
    .web-login-title {
        font-size: 1.55rem;
    }

    .web-login-subtitle {
        font-size: 0.96rem;
    }

    .web-login-logo {
        max-width: 200px;
        max-height: 100px;
    }

    /* Detail rows */
    .apt-detail-time,
    .apt-detail-row {
        padding: 14px 0;
        gap: 12px;
        font-size: 0.96rem;
    }

    .apt-detail-time .material-symbols-outlined,
    .apt-detail-row .material-symbols-outlined {
        font-size: 22px;
    }

    /* FAB */
    .web-fab {
        width: 58px;
        height: 58px;
    }

    .web-fab .material-symbols-outlined {
        font-size: 26px;
    }

    /* Empty states */
    .web-empty {
        padding: 64px 22px;
    }

    .web-empty .material-symbols-outlined {
        font-size: 54px;
    }

    .web-empty p {
        font-size: 0.98rem;
    }
}

/* ----- Spinner ----- */
.web-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: web-spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes web-spin {
    to { transform: rotate(360deg); }
}
