/*
 * Shapeways theme: a light look from the Shapeways 2.0 design system.
 *
 * Everything is scoped to html[data-theme^="shapeways"], which the layouts set from
 * the user's saved choice (PrintShop\Appearance). The default grey.ooo theme has no
 * rules here: it is the unscoped styling in app.css and the brand kit.
 *
 * The palette and the font follow sw-timetracker, which takes them from the design
 * system (sw-front, _sw-dms-colors.scss). Values and sources are in
 * docs/Topics/Themes.md. In short:
 *   navy            #1e2740   headings, the brand bar, the footer
 *   coral           #ff4b5a   the main button (hover #fd3d4d, active #e0424e)
 *   text            #272c3c   body text
 *   greys           #f2f3f4 page, #ebebeb fill, #dad8da line, #5e717c muted
 *   font            Lato 400, 700 and 900
 *
 * Specificity: app.css restates Tailwick's colour scales with !important and plain
 * attribute selectors. The `html[data-theme]` prefix here wins those ties, and the
 * !important is repeated only where the rule being beaten has it.
 */

@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap");

/* `^=` matches every Shapeways theme: shapeways, shapeways-dark and shapeways-auto. */
html[data-theme^="shapeways"] {
    --sw-navy: #1e2740;
    --sw-navy-deep: #1e2740;
    --sw-navy-mid: #415eb0;
    --sw-coral: #ff4b5a;
    --sw-coral-hover: #fd3d4d;
    --sw-coral-active: #e0424e;
    --sw-coral-text: #e0424e;
    --sw-coral-tint: #ffecee;
    --sw-link: #2790c7;
    --sw-grey: #f2f3f4;
    --sw-grey-2: #ebebeb;
    --sw-line: #dad8da;
    --sw-muted: #5e717c;
    --sw-heading: Lato, -apple-system, "Segoe UI", sans-serif;
    --sw-body: Lato, -apple-system, "Segoe UI", sans-serif;
    --sw-text: #272c3c;

    /* Colour roles. The light values are here. The dark theme restates them below. */
    --sw-ink: var(--sw-navy);
    --sw-surface: #ffffff;
    --sw-faint: #8a92ab;
    --sw-line-soft: #e8eaee;
    --sw-line-strong: #c4c9d6;
    --sw-row-hover: var(--sw-row-hover);

    /* Brand kit tokens */
    --gooo-bg: var(--sw-grey);
    --gooo-surface: var(--sw-surface);
    --gooo-surface-2: var(--sw-grey-2);
    --gooo-surface-glass: var(--sw-navy-deep);
    --gooo-border: var(--sw-line);
    --gooo-border-soft: var(--sw-line-soft);
    --gooo-text: var(--sw-text);
    --gooo-text-strong: var(--sw-ink);
    --gooo-muted: var(--sw-muted);
    --gooo-faint: var(--sw-faint);
    --gooo-accent: var(--sw-coral);
    --gooo-accent-dim: rgba(255, 75, 90, 0.12);
    --gooo-danger: #c9283a;
    --gooo-danger-dim: rgba(201, 40, 58, 0.1);
    --gooo-warn: #a86a00;
    --gooo-warn-dim: rgba(168, 106, 0, 0.12);
    --gooo-success: #12805c;
    --gooo-success-dim: rgba(18, 128, 92, 0.12);
    --gooo-radius: 4px;
    --gooo-radius-sm: 3px;
    --gooo-font: var(--sw-body);

    /* Signed-out pages (warm-field.css, auth.css, splash.css) */
    --warm-base: var(--sw-grey);
    --warm-edge: var(--sw-grey);
    --warm-ink: var(--sw-ink);
    --warm-surface: var(--sw-surface);
    --warm-recess: var(--sw-surface);
    --warm-hairline: var(--sw-line);
    --warm-border: var(--sw-line-strong);
    --warm-muted: var(--sw-muted);
    --warm-faint: var(--sw-faint);
    --warm-accent: var(--sw-coral);
    --warm-accent-dim: rgba(255, 75, 90, 0.25);
    --warm-on-accent: #ffffff;
    --warm-danger: #a31d2c;
    --warm-danger-bg: #fdecee;
    --warm-danger-border: #f2b3ba;
    --warm-field-image: none;

    font-family: var(--sw-body);
}

html[data-theme^="shapeways"] body {
    font-family: var(--sw-body);
    background: var(--sw-grey);
    color: var(--sw-text);
}

/* Without the grey.ooo bar the app bar is the top tier. */
html[data-chrome="off"] {
    --gooo-topbar-h: 0px;
}
html[data-chrome="off"] .gooo-appbar__menu {
    display: none;
}
@media (max-width: 900px) {
    html[data-chrome="off"] .gooo-appbar__menu {
        display: inline-flex;
    }
}
.gooo-appbar__menu {
    display: none;
}

/* ---- Headings ------------------------------------------------------------- */

html[data-theme^="shapeways"] h1,
html[data-theme^="shapeways"] h2,
html[data-theme^="shapeways"] h3,
html[data-theme^="shapeways"] .gooo-main__inner h5,
html[data-theme^="shapeways"] .auth__title,
html[data-theme^="shapeways"] .splash__heading {
    font-family: var(--sw-heading);
    font-weight: 900;
    color: var(--sw-ink);
    letter-spacing: 0;
}
html[data-theme^="shapeways"] h4,
html[data-theme^="shapeways"] h6 {
    color: var(--sw-ink);
    font-weight: 700;
}

/* ---- Brand bar (tier 1): deep navy, like the site's dark sections --------- */

html[data-theme^="shapeways"] .gooo-topbar {
    --gooo-surface: var(--sw-navy-deep);
    --gooo-surface-2: var(--sw-navy-mid);
    --gooo-border: var(--sw-navy-mid);
    --gooo-text: #e6e9f2;
    --gooo-text-strong: #ffffff;
    --gooo-muted: #b6bdd2;
    --gooo-faint: #8e97b5;
    background: var(--sw-navy-deep);
    border-bottom-color: var(--sw-navy-mid);
}

/* ---- App bar (tier 2): white, navy text, coral action -------------------- */

html[data-theme^="shapeways"] .gooo-appbar {
    background: var(--sw-surface);
    border-bottom: 1px solid var(--sw-line);
    box-shadow: 0 1px 0 rgba(30, 39, 64, 0.04);
}
html[data-theme^="shapeways"] .gooo-appbar__title {
    color: var(--sw-ink);
    font-family: var(--sw-heading);
    font-weight: 700;
}
/* Shapeways logo, a rule, then the product name. Same lockup as sw-timetracker. */
html[data-theme^="shapeways"] .gooo-appbar__title--sw {
    gap: 0.75rem;
    text-decoration: none;
}
html[data-theme^="shapeways"] .gooo-appbar__title--sw .sw-logo {
    height: 1.25rem;
    width: auto;
}
html[data-theme^="shapeways"] .gooo-appbar__title--sw .sw-product {
    border-left: 1px solid color-mix(in srgb, var(--sw-ink) 30%, transparent);
    padding-left: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-btn--primary,
html[data-theme^="shapeways"] .gooo-btn--primary {
    background: var(--sw-coral);
    border-color: var(--sw-coral);
    color: #ffffff;
    border-radius: 4px;
    font-family: var(--sw-body);
    font-weight: 700;
}
html[data-theme^="shapeways"] .gooo-btn--primary:hover {
    background: var(--sw-coral-hover);
    border-color: var(--sw-coral-hover);
    filter: none;
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-iconbtn {
    color: var(--sw-navy-mid);
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-iconbtn:hover {
    background: var(--sw-grey);
    color: var(--sw-ink);
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-count,
html[data-theme^="shapeways"] .gooo-appbar .gooo-dot {
    background: var(--sw-coral);
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-count {
    color: #ffffff;
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-dot {
    box-shadow: 0 0 0 2px var(--sw-surface);
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-menu {
    background: var(--sw-surface);
    border-color: var(--sw-line);
    box-shadow: 0 10px 30px rgba(30, 39, 64, 0.15);
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-menu__label,
html[data-theme^="shapeways"] .gooo-appbar .gooo-menu__empty {
    color: var(--sw-faint);
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-menu__item {
    background: var(--sw-surface);
    color: var(--sw-ink);
}
html[data-theme^="shapeways"] .gooo-appbar .gooo-menu__item:hover,
html[data-theme^="shapeways"] .gooo-appbar .gooo-menu__row:hover .gooo-menu__item {
    background: var(--sw-grey);
    color: var(--sw-ink);
}

/* ---- Sidebar -------------------------------------------------------------- */

html[data-theme^="shapeways"] .gooo-sidebar {
    background: var(--sw-surface);
    border-right-color: var(--sw-line);
}
html[data-theme^="shapeways"] .gooo-nav__item {
    color: var(--sw-ink);
}
html[data-theme^="shapeways"] .gooo-nav__item:hover {
    background: var(--sw-grey);
    color: var(--sw-ink);
}
html[data-theme^="shapeways"] .gooo-nav__item.is-active {
    background: var(--sw-grey);
    color: var(--sw-ink);
    border-left-color: var(--sw-coral);
    font-weight: 700;
}
html[data-theme^="shapeways"] .gooo-nav__group-label {
    color: var(--sw-faint);
}

/* ---- Page surfaces -------------------------------------------------------- */

html[data-theme^="shapeways"] .gooo-shell,
html[data-theme^="shapeways"] .gooo-main {
    background: var(--sw-grey);
    color: var(--sw-ink);
}
html[data-theme^="shapeways"] .gooo-card,
html[data-theme^="shapeways"] .card {
    background-color: var(--sw-surface);
    border-color: var(--sw-line);
    color: var(--sw-ink);
}
html[data-theme^="shapeways"] .gooo-footer {
    border-top-color: var(--sw-line);
    color: var(--sw-faint);
}
html[data-theme^="shapeways"] .gooo-footer a {
    color: var(--sw-muted);
}
html[data-theme^="shapeways"] .gooo-footer a:hover {
    color: var(--sw-ink);
}

/* ---- Tailwick colour scales (see app.css) -------------------------------- */

/* "custom" and "sky": the accent. Coral is for solid buttons and small marks
   only. Tints, soft buttons and table fills are neutral grey, and text accents
   are the secondary blue, so a page is not a wall of red. */
/* Tints first: `bg-custom-50` is also a prefix of `bg-custom-500`, so the solid
   rules below must come later to win the tie. */
html[data-theme^="shapeways"] [class*="bg-custom-50"],
html[data-theme^="shapeways"] [class*="bg-custom-100"],
html[data-theme^="shapeways"] [class*="bg-sky-50"],
html[data-theme^="shapeways"] [class*="bg-sky-100"] {
    background-color: var(--sw-grey) !important;
}
html[data-theme^="shapeways"] [class*="bg-custom-500"],
html[data-theme^="shapeways"] [class*="bg-sky-500"] {
    background-color: var(--sw-coral) !important;
}
html[data-theme^="shapeways"] [class*="bg-custom-600"],
html[data-theme^="shapeways"] [class*="bg-sky-600"] {
    background-color: var(--sw-coral-hover) !important;
}
html[data-theme^="shapeways"] [class*="bg-custom-400"] {
    background-color: #f26f7a !important;
}
/* Opacity variants (`dark:bg-custom-500/10`) also match the solid rules above,
   and the templates carry them on light elements too. They come last, so they
   win the tie and stay a fill, not a solid coral block. */
html[data-theme^="shapeways"] [class*="bg-custom-500/"],
html[data-theme^="shapeways"] [class*="bg-sky-500/"] {
    background-color: var(--sw-grey) !important;
}
html[data-theme^="shapeways"] table[class*="bg-custom-500/"] {
    background-color: var(--sw-surface) !important;
}
html[data-theme^="shapeways"] [class*="text-custom-400"],
html[data-theme^="shapeways"] [class*="text-custom-500"],
html[data-theme^="shapeways"] [class*="text-custom-600"] {
    color: var(--sw-navy-mid) !important;
}
html[data-theme^="shapeways"] [class*="text-sky-400"],
html[data-theme^="shapeways"] [class*="text-sky-500"],
html[data-theme^="shapeways"] [class*="text-sky-600"],
html[data-theme^="shapeways"] [class*="text-blue-400"],
html[data-theme^="shapeways"] [class*="text-blue-500"],
html[data-theme^="shapeways"] [class*="text-blue-600"] {
    color: var(--sw-link) !important;
}
html[data-theme^="shapeways"] [class*="border-custom-500"],
html[data-theme^="shapeways"] [class*="border-custom-600"],
html[data-theme^="shapeways"] [class*="border-custom-800"],
html[data-theme^="shapeways"] [class*="border-sky-500"],
html[data-theme^="shapeways"] [class*="border-sky-600"] {
    border-color: var(--sw-coral) !important;
}
html[data-theme^="shapeways"] [class*="border-custom-400"] {
    border-color: #f26f7a !important;
}
html[data-theme^="shapeways"] [class*="border-custom-200"],
html[data-theme^="shapeways"] [class*="border-custom-900"] {
    border-color: var(--sw-line) !important;
}
html[data-theme^="shapeways"] [class*="ring-custom-100"],
html[data-theme^="shapeways"] [class*="ring-custom-400"],
html[data-theme^="shapeways"] [class*="ring-sky-100"],
html[data-theme^="shapeways"] [class*="ring-sky-400"],
html[data-theme^="shapeways"] [class*="ring-blue-400"] {
    --tw-ring-color: rgba(255, 75, 90, 0.3) !important;
}

/* "zink": the neutral. The class text also appears inside `dark:` variants, so
   these rules apply here too and must resolve to light values. */
html[data-theme^="shapeways"] [class*="bg-zink-900"],
html[data-theme^="shapeways"] [class*="bg-zink-800"],
html[data-theme^="shapeways"] [class*="bg-zink-700"] {
    background-color: var(--sw-surface) !important;
}
html[data-theme^="shapeways"] [class*="bg-zink-600"],
html[data-theme^="shapeways"] [class*="bg-zink-500"],
html[data-theme^="shapeways"] [class*="bg-zink-400"] {
    background-color: var(--sw-grey-2) !important;
}
html[data-theme^="shapeways"] [class*="border-zink-600"],
html[data-theme^="shapeways"] [class*="border-zink-500"],
html[data-theme^="shapeways"] [class*="border-zink-400"] {
    border-color: var(--sw-line) !important;
}
html[data-theme^="shapeways"] [class*="text-zink-100"] {
    color: var(--sw-ink) !important;
}
html[data-theme^="shapeways"] [class*="text-zink-200"],
html[data-theme^="shapeways"] [class*="text-zink-300"] {
    color: var(--sw-muted) !important;
}
html[data-theme^="shapeways"] [class*="ring-zink-400"] {
    --tw-ring-color: rgba(30, 39, 64, 0.15) !important;
}
html[data-theme^="shapeways"] [class*="text-zink-200"]::placeholder {
    color: var(--sw-faint) !important;
}

/* ---- Tables --------------------------------------------------------------- */

/* A table sits in a white card: a light grey header with small capitals, white
   rows with hairlines between them, and a grey hover. */
html[data-theme^="shapeways"] .overflow-x-auto:has(> table) {
    background: var(--sw-surface);
    border: 1px solid var(--sw-line);
    border-radius: 4px;
    margin-top: 0.75rem;
}
html[data-theme^="shapeways"] .overflow-x-auto:has(> table) + * {
    margin-top: 0.75rem;
}
html[data-theme^="shapeways"] .overflow-x-auto > table {
    background-color: var(--sw-surface) !important;
}
html[data-theme^="shapeways"] table thead {
    background-color: var(--sw-grey) !important;
}
html[data-theme^="shapeways"] table thead th {
    color: var(--sw-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
html[data-theme^="shapeways"] table thead th,
html[data-theme^="shapeways"] table tbody td {
    border-color: var(--sw-line) !important;
    padding: 0.875rem 1.25rem;
}
html[data-theme^="shapeways"] table thead th {
    border-top: 0 !important;
}
html[data-theme^="shapeways"] table tbody tr:last-child td {
    border-bottom: 0 !important;
}
html[data-theme^="shapeways"] table tbody tr:hover td {
    background-color: var(--sw-row-hover);
}

/* ---- Spacing --------------------------------------------------------------- */

/* More room round the content, like the site: a wider gutter, a page title
   with space under it, and space between a section heading and its block. */
html[data-theme^="shapeways"] .gooo-main__inner {
    padding: 2rem 2.5rem 3rem;
}
html[data-theme^="shapeways"] .gooo-main__inner > div:first-child {
    padding-top: 0;
    padding-bottom: 1.5rem;
}
html[data-theme^="shapeways"] .gooo-main__inner h5 {
    font-size: 1.5rem;
    line-height: 1.25;
}
html[data-theme^="shapeways"] .gooo-main__inner h6 {
    font-size: 1rem;
}
@media (max-width: 900px) {
    html[data-theme^="shapeways"] .gooo-main__inner {
        padding: 1.5rem 1rem 2rem;
    }
}

/* ---- Buttons, inputs ------------------------------------------------------ */

html[data-theme^="shapeways"] .btn {
    font-family: var(--sw-body);
    font-weight: 700;
    border-radius: 4px;
}
html[data-theme^="shapeways"] .form-input,
html[data-theme^="shapeways"] .form-select {
    border-radius: 3px;
}

/* ---- Build panel and commit graph ---------------------------------------- */

html[data-theme^="shapeways"] .build-dialog {
    background: var(--sw-surface);
    color: var(--sw-ink);
    border-color: var(--sw-line);
    box-shadow: 0 25px 50px -12px rgba(30, 39, 64, 0.3);
}
html[data-theme^="shapeways"] .build-dialog::backdrop {
    background: rgba(30, 39, 64, 0.55);
}
html[data-theme^="shapeways"] .build-panel__title,
html[data-theme^="shapeways"] .git-graph__subject,
html[data-theme^="shapeways"] .git-graph__merged-branch,
html[data-theme^="shapeways"] .build-panel__empty code {
    color: var(--sw-ink);
}
html[data-theme^="shapeways"] .build-panel__blurb,
html[data-theme^="shapeways"] .build-panel__close {
    color: var(--sw-muted);
}
html[data-theme^="shapeways"] .build-panel__legend,
html[data-theme^="shapeways"] .git-graph__merged-label,
html[data-theme^="shapeways"] .git-graph__meta,
html[data-theme^="shapeways"] .git-graph__badge--more {
    color: var(--sw-faint);
}
html[data-theme^="shapeways"] .build-panel__sha,
html[data-theme^="shapeways"] .build-panel__close {
    border-color: var(--sw-line);
}
html[data-theme^="shapeways"] .git-graph__dot {
    stroke: var(--sw-surface);
}
html[data-theme^="shapeways"] .git-graph__dot--merge {
    fill: var(--sw-surface);
}
html[data-theme^="shapeways"] .git-graph__badge--branch {
    color: var(--sw-ink);
    background: var(--sw-grey);
}

/* ---- Settings screen ------------------------------------------------------ */

html[data-theme^="shapeways"] .settings-section {
    background: var(--sw-surface);
    border-color: var(--sw-line);
}
html[data-theme^="shapeways"] .theme-choice:has(input:checked) {
    border-color: var(--sw-ink);
    box-shadow: 0 0 0 1px var(--sw-ink);
}
html[data-theme^="shapeways"] .ps-switch:checked,
html[data-theme^="shapeways"] .ps-switch-mark.is-on {
    background-color: var(--sw-navy-mid) !important;
    border-color: var(--sw-navy-mid) !important;
}
html[data-theme^="shapeways"] .quick-look__check {
    color: var(--sw-navy-mid);
}
html[data-theme^="shapeways"] .quick-look .gooo-menu__item {
    color: var(--sw-ink);
}

/* ---- Shapeways dark ------------------------------------------------------- */

/* The dark values from sw-timetracker (assets/styles/app.css there). They apply to
   shapeways-dark, and to shapeways-auto when the head script set the `dark` class
   because the browser asks for dark. Coral stays the call to action. */
html[data-theme="shapeways-dark"],
html[data-theme="shapeways-auto"].dark {
    color-scheme: dark;
    --sw-navy-deep: #0d1222;
    --sw-navy-mid: #8fa4e6;
    --sw-coral-text: #ff7a86;
    --sw-link: #5cbcf0;
    --sw-grey: #12172a;
    --sw-grey-2: #333c5e;
    --sw-line: #46507a;
    --sw-muted: #a4abbd;
    --sw-text: #e8eaf2;
    --sw-ink: #ffffff;
    --sw-surface: #1b2238;
    --sw-faint: #7c8499;
    --sw-line-soft: #2c3557;
    --sw-line-strong: #46507a;
    --sw-row-hover: #232b45;

    --gooo-danger: #ff7a86;
    --gooo-danger-dim: rgba(255, 122, 134, 0.14);
    --gooo-warn: #f0b34a;
    --gooo-warn-dim: rgba(240, 179, 74, 0.14);
    --gooo-success: #4fd1a1;
    --gooo-success-dim: rgba(79, 209, 161, 0.14);
    --warm-danger: #ff7a86;
    --warm-danger-bg: #2a1d2c;
    --warm-danger-border: #6b3442;
}
html[data-theme="shapeways-dark"] .gooo-topbar,
html[data-theme="shapeways-auto"].dark .gooo-topbar {
    --gooo-surface-2: #26304f;
    --gooo-border: #26304f;
    border-bottom-color: #26304f;
}
html[data-theme="shapeways-dark"] .gooo-appbar,
html[data-theme="shapeways-auto"].dark .gooo-appbar {
    box-shadow: none;
}
html[data-theme="shapeways-dark"] .gooo-appbar .gooo-menu,
html[data-theme="shapeways-auto"].dark .gooo-appbar .gooo-menu {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* ---- Footer: the build sha sits in the middle, pinned to the bottom ------- */

/* Same as sw-timetracker: the main column is at least the height of the screen,
   so the footer is at the bottom even on a short page. */
html[data-theme^="shapeways"] .gooo-footer {
    margin-top: auto;
    text-align: center;
}
html[data-theme^="shapeways"] .gooo-footer > div {
    justify-content: center;
}
html[data-theme^="shapeways"] .gooo-footer__build {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-decoration: none;
    color: var(--sw-muted);
}
html[data-theme^="shapeways"] .gooo-footer__build:hover {
    color: var(--sw-ink);
}

/* ---- Floating Light / Auto / Dark switch, bottom left --------------------- */

.sw-mode {
    position: fixed;
    left: 0.75rem;
    bottom: 0.75rem;
    z-index: 40;
    margin: 0;
}
.sw-mode__group {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--sw-line);
    border-radius: 999px;
    background: var(--sw-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-size: 0.75rem;
    font-weight: 700;
}
.sw-mode__group button {
    border: 0;
    padding: 0.375rem 0.75rem;
    background: transparent;
    color: var(--sw-ink);
    font: inherit;
    cursor: pointer;
}
.sw-mode__group button:hover {
    background: var(--sw-grey);
}
.sw-mode__group button[aria-pressed="true"] {
    background: var(--sw-coral);
    color: #ffffff;
}
/* The sidebar scrolls on its own. Space at its end lets the last items scroll
   clear of the switch on a short screen. */
html[data-theme^="shapeways"] .gooo-sidebar {
    padding-bottom: 4rem;
}
/* Below 900 px there is no sidebar under the switch, so keep the footer clear of it. */
@media (max-width: 900px) {
    html[data-theme^="shapeways"] .gooo-footer {
        padding-bottom: 3.5rem;
    }
}
