@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
    --gml-bg: #f6f3ee;
    --gml-card: #ffffff;
    --gml-accent: #1f6feb;
    --gml-accent-dark: #144ea8;
    --gml-text: #1a1a1a;
    --gml-muted: #5a5a5a;
    --gml-border: #e2ded7;
    --gml-shadow: 0 12px 30px rgba(17, 12, 34, 0.12);
}

.gml-lt-app {
    font-family: 'Space Grotesk', 'Helvetica Neue', sans-serif;
    color: var(--gml-text);
    background: radial-gradient(circle at top left, #fff6e5 0%, var(--gml-bg) 40%, #e7f0ff 100%);
    padding: 1rem;
    border-radius: 16px;
}

.gml-lt-app,
.gml-lt-app *,
.gml-lt-app *::before,
.gml-lt-app *::after {
    box-sizing: border-box;
}

.gml-lt-index {
    padding: 1rem;
    background: radial-gradient(circle at top left, #fff6e5 0%, var(--gml-bg) 40%, #e7f0ff 100%);
    border-radius: 16px;
}

.gml-lt-index-tabs {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 0;
    max-width: 360px;
}

.gml-lt-index-item {
    margin: 0;
}

.gml-lt-index-section {
    margin-bottom: 1.5rem;
}

.gml-lt-section {
    background: var(--gml-card);
    border: 1px solid var(--gml-border);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--gml-shadow);
    animation: gml-fade-in 0.6s ease both;
}

.gml-lt-section h2 {
    margin-top: 0;
    font-weight: 600;
}

.gml-lt-controls,
.gml-lt-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
    margin-bottom: 1rem;
    max-width: 100%;
}

.gml-lt-controls > *,
.gml-lt-grid > * {
    min-width: 0;
}

.gml-lt-form label,
.gml-lt-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--gml-muted);
    min-width: 0;
    overflow: hidden;
}

.gml-lt-form input,
.gml-lt-form select,
.gml-lt-form textarea,
.gml-lt-controls input,
.gml-lt-controls select {
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--gml-border);
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    color: var(--gml-text);
    background: #fff;
}

.gml-lt-form select option,
.gml-lt-controls select option {
    color: var(--gml-text);
    background: #fff;
}

.gml-lt-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.75rem;
}

.gml-lt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.gml-lt-table th,
.gml-lt-table td {
    border: 1px solid var(--gml-border);
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.gml-lt-table input[type="number"] {
    width: 72px;
    max-width: 100%;
    padding: 0.25rem;
}

.gml-lt-table thead {
    background: #f1efe9;
}

.gml-lt-primary,
.gml-lt-secondary {
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
}

.gml-lt-primary:disabled,
.gml-lt-secondary:disabled {
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
}

.gml-lt-primary {
    background: #ffe9b3;
    border: 1px solid #f3c04f;
}

.gml-lt-primary:hover {
    background: #ffd88a;
}

.gml-lt-secondary {
    background: #ffffff;
    border: 1px solid var(--gml-border);
}

.gml-lt-section h2,
.gml-lt-section label,
.gml-lt-section th,
.gml-lt-section td {
    color: var(--gml-text);
}

.gml-lt-message {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--gml-muted);
}

.gml-lt-notice {
    background: #fff0f0;
    border: 1px solid #f2bcbc;
    padding: 0.75rem;
    border-radius: 10px;
}

.gml-lt-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    position: sticky;
    top: 0.5rem;
    z-index: 10;
    background: rgba(246, 243, 238, 0.9);
    padding: 0.5rem;
    border-radius: 12px;
    backdrop-filter: blur(6px);
    color: #1a1a1a;
}

.gml-lt-anchor-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    position: sticky;
    top: 0.5rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--gml-border);
    backdrop-filter: blur(6px);
}

.gml-lt-back {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.gml-lt-back-btn {
    border: 1px solid var(--gml-border);
    background: #ffffff;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.gml-lt-anchor-btn {
    border: 1px solid var(--gml-border);
    background: #ffffff;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
    text-decoration: none;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.gml-lt-line-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    position: sticky;
    top: 0.5rem;
    z-index: 9;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--gml-border);
    backdrop-filter: blur(6px);
}

.gml-lt-line-btn {
    border: 1px solid var(--gml-border);
    background: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
}

.gml-lt-line-btn.is-active {
    background: #ffe9b3;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
    border-color: #f3c04f;
}

.gml-lt-tab {
    border: 1px solid var(--gml-border);
    background: #fff;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
}

.gml-lt-tab.is-active {
    background: #ffe9b3;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
    border-color: #f3c04f;
}

/* Theme select replacements (nice-select) inside the app */
.gml-lt-app .nice-select,
.gml-lt-app .nice-select .current,
.gml-lt-app .nice-select .list li {
    color: #1a1a1a !important;
}
.gml-lt-app .nice-select {
    background: #fff !important;
    border-color: var(--gml-border) !important;
    position: relative;
    z-index: 5;
}

.gml-lt-app .nice-select .list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--gml-border);
    border-radius: 10px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.gml-lt-app .nice-select.open .list {
    display: block;
}

.gml-lt-app button,
.gml-lt-app .gml-lt-primary,
.gml-lt-app .gml-lt-secondary {
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
}

.gml-lt-app input,
.gml-lt-app select,
.gml-lt-app textarea {
    color: #1a1a1a !important;
    max-width: 100%;
    min-width: 0;
}

.gml-lt-app input[type="date"],
.gml-lt-app input[type="datetime-local"],
.gml-lt-app input[type="time"],
.gml-lt-app input[type="month"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-inline-size: 0;
    max-inline-size: 100%;
    inline-size: 100%;
    display: block;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-clip: padding-box;
}

.gml-lt-app input[type="date"]::-webkit-date-and-time-value,
.gml-lt-app input[type="datetime-local"]::-webkit-date-and-time-value,
.gml-lt-app input[type="time"]::-webkit-date-and-time-value,
.gml-lt-app input[type="month"]::-webkit-date-and-time-value {
    text-align: left;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Force native selects inside plugin to avoid theme conflicts */
.gml-lt-app select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.gml-lt-app .nice-select {
    display: none !important;
}

.gml-lt-hidden {
    display: none;
}

.gml-lt-prep-list {
    display: grid;
    gap: 0.75rem;
}

.gml-lt-prep-card {
    border: 1px solid var(--gml-border);
    border-radius: 12px;
    padding: 0.75rem;
    background: #fff;
}

.gml-lt-prep-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gml-lt-prep-items {
    display: grid;
    gap: 0.4rem;
}

.gml-lt-prep-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.gml-lt-break-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.gml-lt-break-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gml-border);
    border-radius: 10px;
    background: #fff;
    font-size: 0.9rem;
}

.gml-lt-break-card button {
    border: 1px solid var(--gml-border);
    background: #fff;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: #1a1a1a !important;
}

.gml-lt-summary {
    font-size: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .gml-lt-app {
        padding: 0.75rem;
    }
    .gml-lt-section {
        padding: 0.75rem;
    }
    .gml-lt-table {
        font-size: 0.82rem;
    }
    .gml-lt-controls,
    .gml-lt-grid {
        grid-template-columns: 1fr;
    }
    .gml-lt-tabs {
        top: auto;
        bottom: 0.75rem;
    }
}

@supports (-webkit-touch-callout: none) {
    .gml-lt-controls,
    .gml-lt-grid {
        grid-template-columns: 1fr;
    }
    .gml-lt-app input[type="date"],
    .gml-lt-app input[type="datetime-local"],
    .gml-lt-app input[type="time"],
    .gml-lt-app input[type="month"] {
        font-size: 0.9rem;
    }
}

@keyframes gml-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
