:root {
    --color-bg: #eef2f6;
    --color-surface: #ffffff;
    --color-primary: #1a365d;
    --color-primary-soft: #2c5282;
    --color-text: #1a202c;
    --color-muted: #4a5568;
    --color-border: #cbd5e0;
    --color-online: #2f855a;
    --color-offline: #c53030;
    --color-edit: #2b6cb0;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(26, 54, 93, 0.1);
    --font-base: 1.125rem;
    --font-title: 1.5rem;
    --touch-min: 3.25rem;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-base);
    line-height: 1.5;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

#app-root {
    min-height: 100vh;
    min-height: 100dvh;
}

body.hestia--app-open {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

body.hestia--app-open #app-root {
    height: 100%;
    overflow: hidden;
}

.hestia {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 1.25rem;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

.hestia-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.hestia-header__titles {
    min-width: 0;
}

.hestia-views {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.hestia-view {
    display: none;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.btn-back {
    flex-shrink: 0;
    min-height: var(--touch-min);
    padding: 0.5rem 0.875rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-back[aria-hidden="true"] {
    visibility: hidden;
    pointer-events: none;
}

.btn-back:hover,
.btn-back:focus-visible {
    border-color: var(--color-primary);
    outline: none;
}

.btn-edit[aria-hidden="true"] {
    display: none;
}

.hestia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.hestia-header__title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.hestia-header__status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 0;
    font-size: 1rem;
    color: var(--color-muted);
}

.status__indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-muted);
    flex-shrink: 0;
}

.status__indicator--online {
    background: var(--color-online);
}

.status__indicator--offline {
    background: var(--color-offline);
}

.btn-edit {
    min-height: var(--touch-min);
    min-width: 10rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--color-edit);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-edit);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-edit:hover,
.btn-edit:focus-visible {
    background: var(--color-edit);
    color: #fff;
    outline: none;
}

.btn-edit[aria-pressed="true"] {
    background: var(--color-edit);
    color: #fff;
}

.edit-hint {
    margin: 0 0 1rem;
    padding: 1rem 1.25rem;
    background: #ebf8ff;
    border: 2px solid #90cdf4;
    border-radius: var(--radius);
    color: var(--color-primary);
    font-size: 1.125rem;
    text-align: center;
}
