:root {
    color-scheme: light;
    --bg: #ffffff;
    --panel: #f5f5f5;
    --card: #ffffff;
    --text: #565656;
    --muted: #8a8580;
    --primary: #FFDE0B;
    --primary-dark: #e6c800;
    --danger: #f87171;
    --border: #d4d2cf;
    --accent: #595551;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
}

body {
    background: var(--primary);
    color: var(--text);
    min-height: 100vh;
    padding: 10px 16px 16px;
    overflow: hidden;
}

.app {
    max-width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 7% 15% 66% 12%;
    gap: 8px;
    height: calc(100vh - 32px);
    overflow: hidden;
}

.app__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    background: var(--panel);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.header__logo {
    height: 40px;
    width: auto;
    justify-self: center;
}

.header__right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.status-inline {
    color: var(--muted);
    font-size: 13px;
}

h1 {
    font-size: 18px;
}

.subtitle {
    color: var(--muted);
    margin-top: 2px;
    font-size: 12px;
}

.card {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.4);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card--info {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(15, 23, 42, 0.7));
}

.form {
    display: grid;
    gap: 4px;
    margin-top: 4px;
}

.card h2 {
    font-size: 17px;
    margin-bottom: 8px;
    font-weight: 700;
}

.field {
    display: grid;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}

.field input,
.field textarea {
    padding: 14px 16px;
    background: #ffffff;
    border: 2px solid var(--accent);
    border-radius: 10px;
    color: var(--text);
    font-size: 16px;
    min-height: 48px;
}

.field input:focus,
.field textarea:focus {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
}

.form__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn--primary {
    background: var(--accent);
    color: #ffffff;
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(89, 85, 81, 0.3);
}

.btn--ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn--ghost:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.status {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.list {
    list-style: none;
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.list__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list__item {
    background: #0b132a;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: grid;
    gap: 6px;
}

.list__title {
    font-weight: 600;
}

.list__note {
    color: var(--muted);
    font-size: 14px;
}

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

.badge {
    background: rgba(56, 189, 248, 0.2);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.item__actions button {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
    margin-top: 6px;
}

.selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.selector__option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: #ffffff;
    border: 2px solid var(--accent);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    min-height: 52px;
}

.selector__option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.selector__option input {
    margin: 0;
}

.selector__option span {
    font-weight: 600;
}

.window-display {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
    margin-top: 8px;
    height: 100%;
}

.window-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    justify-items: center;
}

.window-image {
    aspect-ratio: 4/5;
    background: #ffffff;
    border: 3px solid var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
}

.window-image img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.material {
    padding: 14px 18px;
    background: #ffffff;
    border: 2px solid var(--accent);
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    color: var(--accent);
    font-size: 26px;
    min-width: 90px;
}

.material--top,
.material--bottom {
    justify-self: center;
    width: 60%;
}

.material--left {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    height: 90%;
}

.material--right {
    writing-mode: vertical-rl;
    height: 90%;
}

.dimension-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 640px) {
    .dimension-inputs {
        grid-template-columns: 1fr;
    }

    .window-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .material--left,
    .material--right {
        writing-mode: horizontal-tb;
    }
}
