:root {
  color-scheme: light;
  font: 100%/1.5 "Instrument Sans", "Segoe UI", sans-serif;
  color: #242821;
  background: #f7f5ee;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; overflow-x: clip; }
img, svg, canvas, video { max-width: 100%; }
a { color: inherit; }
.page { width: min(1120px, calc(100% - 2.5rem)); margin-inline: auto; }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cbc8bb;
  padding-block: 1.25rem;
}
.brand {
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.025em;
  text-transform: uppercase;
  text-decoration: none;
}
.intro { padding-block: clamp(2rem, 6vw, 5rem) 2rem; }
h1, h2, p, figure { margin: 0; }
h1, #config-heading {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -.045em;
}
h1 { font-size: clamp(2.35rem, 7.5vw, 6rem); }
.intro p { margin-top: 1rem; max-width: 46ch; color: #4e544a; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.stage {
  min-height: 15rem;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at 45% 34%, #f2ece0, #ddd6c7);
}
.design { display: block; max-width: 100%; max-height: 13rem; height: auto; filter: drop-shadow(0 .55rem .4rem #2b281e35); }
.design.skilt { fill: #fff6df; }
.skilt .outline { fill: #38473c; }
.design.bordbrikke { fill: #3b271b; }
.bordbrikke .outline { fill: #ca9f77; }
.design.editor-art { fill: var(--engraving, #4a2e18); }
.editor-art .outline { fill: var(--surface, #bd9060); }
.editor-art .raised-art { fill: var(--raised, #d9b183); }
figcaption, .field-help { color: #53574d; }
button, input, select { font: inherit; }
button {
  cursor: pointer;
  border: 0;
  border-radius: .35rem;
  background: #314336;
  color: #fffdf7;
  font-weight: 600;
  padding: .55rem 1.1rem;
}
button:hover { background: #425649; }
:focus-visible { outline: 2px solid #365d47; outline-offset: 3px; }
.configurator { margin-block: 2rem 4rem; padding-top: 1.5rem; border-top: 1px solid #cbc8bb; }
#config-heading { margin-bottom: 1.25rem; font-size: clamp(2rem, 5vw, 3.4rem); }
form { display: grid; gap: .45rem; }
[hidden] { display: none !important; }
#login, #rates { max-width: 30rem; margin-block: 1rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
label { display: block; font-weight: 600; }
input, select, textarea { width: 100%; padding: .5rem; border: 1px solid #817d70; border-radius: .25rem; background: #fffdf7; color: inherit; }
.dimensions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.dimensions label { margin-bottom: .45rem; }
.field-help { font-size: .875rem; }
figure .stage { border-radius: .75rem; }
figcaption { margin-top: .5rem; }
button:disabled { cursor: default; opacity: .55; }
.order-panel { margin-top: 1rem; padding: 1rem; background: #fffdf7; border: 1px solid #d7d2c4; border-radius: .75rem; }
.order-panel > :not(:first-child) { margin-top: .5rem; }
.notice { padding: .7rem; background: #f3e8cc; border-radius: .3rem; }
.total { font-size: 1.25rem; font-weight: 700; }
.price-lines { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; }
.price-lines dd { margin: 0; text-align: right; }
.price-lines > :nth-last-child(-n+2) { font-weight: 700; }
.confirmation { display: flex; align-items: center; gap: .5rem; padding-block: .5rem; }
.confirmation input { width: auto; }
.quantity { width: 6rem; }
#go-checkout { margin-block: 1rem; }
#checkout label { margin-block: .4rem; }
#checkout-status { margin-top: 1rem; }
.order-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.store-nav { flex-wrap: wrap; justify-content: end; }
#cart-menu { position: relative; }
#cart-menu summary { cursor: pointer; font-weight: 600; list-style: none; white-space: nowrap; }
#cart-menu summary::after { content: " ▾"; }
#cart-menu-panel {
  position: absolute; z-index: 5; right: 0; top: calc(100% + .75rem);
  width: min(21rem, calc(100vw - 2.5rem)); padding: 1rem;
  background: #fffdf7; border: 1px solid #d7d2c4; border-radius: .5rem;
  box-shadow: 0 .5rem 1.5rem #342b2226;
}
#cart-menu-panel ul { list-style: none; margin: 0 0 .75rem; padding: 0; max-height: min(45vh, 18rem); overflow: auto; }
#cart-menu-panel li, .cart-line-title { display: flex; gap: .75rem; align-items: center; }
#cart-menu-panel li + li { border-top: 1px solid #d7d2c4; margin-top: .5rem; padding-top: .5rem; }
.cart-thumbnail { flex: 0 0 3.5rem; height: 2.6rem; display: grid; place-items: center; background: #eee5d5; border-radius: .25rem; font-size: .8rem; }
.cart-thumbnail svg { display: block; width: 85%; height: 85%; }
.cart-thumbnail img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.store-nav .cart-checkout-link { display: block; margin-top: .6rem; padding: .5rem .75rem; color: #fffdf7; background: #314336; border-radius: .35rem; text-align: center; }
#basket { margin-top: 1.5rem; }
.raised .lettering { filter: drop-shadow(.4px .65px .35px #141b15); }
#order-error, #startup-error { color: #8b2a19; }
main { padding-bottom: 2rem; }

.store-nav { display: flex; gap: clamp(.8rem, 3vw, 2rem); }
.store-nav a, .store-link, .catalog-card { text-decoration: none; }
.store-nav a:hover { text-decoration: underline; }
.store-nav { align-items: center; }
.store-nav .admin-login-link { padding: .3rem .65rem; border: 1px solid #817d70; border-radius: .35rem; font-weight: 600; }
.store-nav .nav-button { padding: 0; background: transparent; color: inherit; font-weight: 400; }
.store-nav .nav-button:hover { text-decoration: underline; }
dialog { width: min(44rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: 1.5rem; border: 1px solid #cbc8bb; border-radius: .65rem; color: inherit; background: #fffdf7; }
dialog::backdrop { background: #18251fb3; }
.dialog-heading { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.contact-details { display: grid; gap: .65rem; }
.gallery-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.gallery-list img { display: block; width: 100%; height: auto; border-radius: .35rem; }
.fixed-photo { width: 100%; aspect-ratio: 1.65; object-fit: cover; }
.fixed-detail-photo { display: block; max-width: min(100%, 38rem); max-height: 30rem; margin-block: 1rem; }
.admin-product-photo { display: block; width: min(100%, 12rem); margin-block: .5rem; }
.month-folder { border: 1px solid #cbc8bb; padding: 1rem; margin-block: 1rem; border-radius: .35rem; }
.month-folder summary { cursor: pointer; font-weight: 600; margin-bottom: .5rem; }
#contact-form, #gallery-form { max-width: 30rem; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; border-bottom: 1px solid #cbc8bb; padding-bottom: 1rem; }
.admin-tabs [aria-pressed="false"] { background: #e8e3d7; color: #27372d; }
.admin-panel > h2 { margin-block: 1.5rem 1rem; }
.inactive-section { border-top: 1px solid #aaa99c; margin-top: 2rem; padding-top: 1.5rem; }
.limit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
#treatment-form, #treatment-list { max-width: 30rem; }
#slideshow { min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; background: #1e2b23; }
.store-hero #slide-image { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
#slide-caption { padding: .6rem 1rem; margin: 0; color: #f4f0e4; }
#slide-controls { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem 1rem 1rem; }
#slide-controls button { background: #eee3c9; color: #27372d; }
@media (max-width: 480px) { .gallery-list { grid-template-columns: 1fr; } }
.button-link { display: inline-block; cursor: pointer; border-radius: .35rem; background: #314336; color: #fffdf7; font-weight: 600; padding: .55rem 1.1rem; text-decoration: none; }
.button-link:hover { background: #425649; }
.masthead { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1rem; }
.brand { justify-self: start; }
.brand img { display: block; width: 130px; height: 88px; object-fit: contain; }
.masthead .store-nav { justify-content: center; }
.header-actions { display: flex; align-items: center; justify-self: end; gap: 1rem; }
.admin-login-link { padding: .3rem .65rem; border: 1px solid #817d70; border-radius: .35rem; text-decoration: none; font-weight: 600; }
.masthead > a:last-child:not(.brand) { grid-column: 3; justify-self: end; }
#rates { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.25rem; }
#rates #rate-status { grid-column: 1 / -1; }
#treatment-list, #custom-products, #manage-products, #inactive-products { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
#treatment-list .order-panel, #custom-products .order-panel, #manage-products .order-panel, #inactive-products .order-panel { margin-top: 0; }
#manage-products { margin-top: 1rem; }
#home-form { max-width: 40rem; }
.editor-art.hide-guides g[data-kind], .editor-art.hide-guides .safe-edge { display: none; }
.editor-art.hide-guides g[data-element-id] { display: none; }
.product-title-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
#product-details { padding-top: 1.25rem; padding-bottom: .5rem; }
#product-title { margin: 0; font: 600 clamp(1.05rem, 2vw, 1.45rem)/1.3 "Instrument Sans", "Segoe UI", sans-serif; letter-spacing: normal; }
.element-actions { display: flex; gap: .5rem; }
.element-actions button { padding: .4rem .6rem; font-size: .8rem; }
#element-editors { display: grid; gap: .65rem; }
#design-form #product-price { padding: .7rem; margin-top: .25rem; }
#design-form #product-price .total { font-size: 1.1rem; }
#design-form #product-price label { display: inline-block; }
#design-form #quantity { width: 3.8rem; display: inline-block; padding: .3rem; }
#design-form #add-to-cart { width: 100%; margin-top: .5rem; padding: .45rem; font-size: .85rem; }
.zoom-toolbar .confirmation { margin-left: auto; font-size: .85rem; }
.treatment-color { display: flex; align-items: center; gap: .5rem; }
.treatment-color input[type="checkbox"] { width: auto; }
.treatment-color input[type="color"] { width: 3rem; height: 2rem; padding: .1rem; margin-left: auto; }
.delete-button { background: #7d3628; margin-inline: .5rem; }
.delete-button:hover { background: #963e2c; }
.art-shape { cursor: grab; }
.preview-3d { margin-top: 1.5rem; }
.preview-3d h2 { font-size: 1.25rem; margin-bottom: .65rem; }
#preview-3d-canvas { width: 100%; min-height: 220px; border-radius: .65rem; overflow: hidden; background: #e9e3d8; }
#preview-3d-canvas canvas { display: block; width: 100%; }
.view-buttons { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: .75rem; }
.view-buttons button { padding: .4rem .7rem; font-size: .9rem; }
.view-buttons [aria-pressed="false"] { background: #e0dacb; color: #27372d; }
#preview-3d-status { margin-bottom: .5rem; color: #53574d; font-size: .9rem; }
#tilpass .config-grid { grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: 1.5rem; }
#design-form { align-content: start; font-size: .875rem; gap: .75rem; }
#design-form input, #design-form select, #design-form textarea { padding: .4rem; }
#design-form textarea { resize: vertical; line-height: 1.35; }
#design-form details { border: 1px solid #cbc8bb; border-radius: .35rem; min-width: 0; background: #fffdf7; }
#design-form summary { padding: .65rem; cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.collapse-content { display: grid; gap: .55rem; padding: .65rem; border-top: 1px solid #ded8cb; }
#design-form .position-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#design-form .position-fields > label:first-child { grid-column: 1 / -1; }
#design-form fieldset { margin: 0; padding: .5rem; }
#tilpass #preview { height: 450px; padding: 0; overflow: hidden; }
#preview .editor-art { width: 100%; height: 100%; max-width: none; max-height: none; filter: none; }
.editor-art.panning, .editor-art.panning * { cursor: grabbing; }
.zoom-toolbar { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.zoom-toolbar button { padding: .4rem .7rem; }
.zoom-toolbar output { min-width: 3rem; text-align: center; }
#preview-3d-canvas { min-height: 300px; }
.touch-help { display: none; }
@media (pointer: coarse) {
  .mouse-help { display: none; }
  .touch-help { display: inline; }
}
#show-3d { width: 100%; }
/* Mobil: forhåndsvisningen ligger fast øverst, valgene under, pris og handlekurv fast nederst. */
@media (max-width: 767px) {
  #tilpass .config-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  #tilpass figure { display: contents; }
  #tilpass .stage-wrap { order: -1; position: sticky; top: 0; z-index: 5; margin-inline: -1.25rem; padding: .5rem 1.25rem .4rem;
    background: #f7f5ee; box-shadow: 0 6px 10px -8px #0005; }
  #tilpass #preview { height: min(32vh, 240px); }
  .zoom-toolbar { gap: .3rem; margin-bottom: .35rem; white-space: nowrap; }
  .zoom-toolbar button { padding: .3rem .6rem; font-size: .85rem; }
  .zoom-toolbar output { min-width: 2.6rem; font-size: .85rem; }
  .zoom-toolbar .confirmation { font-size: .8rem; }
  .stage-help { margin: .25rem 0 0; font-size: .75rem; }
  #design-form { font-size: 1rem; }
  #design-form input, #design-form select, #design-form textarea { padding: .55rem; font-size: 1rem; }
  #design-form summary { padding: .8rem; }
  .element-actions button { flex: 1; padding: .7rem; font-size: .95rem; }
  #preview-3d-canvas { min-height: 240px; }
  #design-form #product-price:not([hidden]) { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
    margin-inline: -1.25rem; padding: .7rem 1.25rem calc(.7rem + env(safe-area-inset-bottom)); border-radius: 0;
    box-shadow: 0 -6px 10px -8px #0005; }
  #design-form #product-price .total { flex: 1 1 auto; margin: 0; font-size: 1.1rem; }
  #design-form #product-price label[for="quantity"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #design-form #product-price #quantity { width: 3.4rem; padding: .55rem .3rem; }
  #design-form #product-price #add-to-cart { flex: 0 1 auto; width: auto; margin: 0; padding: .75rem; font-size: 1rem; }
  #design-form #product-price #cart-feedback { flex-basis: 100%; margin: 0; }
  #design-form #product-price #cart-feedback:empty { display: none; }
}
#slideshow { position: relative; }
.slide-viewport { position: relative; overflow: hidden; width: 100%; }
.slide-viewport img { display: block; }
.slide-viewport .incoming-slide { position: absolute; inset: 0; }
#slide-controls { position: absolute; top: 0; left: 0; right: 0; aspect-ratio: 3 / 2; align-items: center; pointer-events: none; padding: .5rem; }
#slide-controls button { pointer-events: auto; border-radius: 50%; background: #fffdf7e6; color: #27372d; width: 2.5rem; height: 2.5rem; padding: 0; box-shadow: 0 1px 6px #0003; }
@media (max-width: 760px) {
  .masthead { grid-template-columns: 1fr auto; }
  .brand img { width: 100px; height: 68px; }
  .header-actions { gap: .5rem; }
  .masthead .store-nav { grid-row: 2; grid-column: 1 / -1; }
  .header-actions { grid-row: 1; grid-column: 2; }
  .masthead > a:last-child:not(.brand) { grid-column: 2; }
  #rates, #treatment-list, #custom-products, #manage-products, #inactive-products { grid-template-columns: 1fr; }
}
.store-hero { display: grid; grid-template-columns: 1fr 1.2fr; margin-top: 1.6rem; background: #27372d; color: #fff8e9; }
.hero-copy { align-self: center; padding: clamp(1.4rem, 4vw, 3.5rem); }
.hero-copy h1 { font-size: clamp(2.5rem, 5.7vw, 5rem); }
.hero-copy p { margin-top: 1rem; max-width: 32ch; color: #e1e5d9; }
.store-hero img { width: 100%; height: 100%; object-fit: cover; }
.store-link { display: inline-flex; gap: .8rem; margin-top: 1.6rem; padding: .7rem 1rem; background: #f0dfbc; color: #242821; font-weight: 600; }
.store-link:hover { background: #fff0cf; }
.catalog-section { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.catalog-section h2 { font: 400 clamp(2rem, 4vw, 3.4rem)/1.08 Georgia, serif; letter-spacing: -.045em; }
.catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.catalog-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #fffdf7; border: 1px solid #d7d2c4; }
.catalog-card:hover { border-color: #525d48; }
.catalog-label { display: flex; justify-content: space-between; gap: .6rem; align-items: start; padding: .9rem 1rem 1rem; }
.catalog-label h3 { margin: .15rem 0 0; font-size: 1.05rem; line-height: 1.3; }
.product-code { color: #53574d; font-size: .85rem; }
.product-art { display: grid; place-items: center; width: 100%; min-width: 0; aspect-ratio: 1.65; padding: 1rem; background: radial-gradient(ellipse at 45% 30%, #eee7d9, #ded3bd); }
.sample {
  display: grid; place-items: center; width: min(84%, 18rem); aspect-ratio: 2.75;
  border-radius: .35rem; background: repeating-linear-gradient(176deg, #ffffff08 0 3px, #633c1814 4px 6px), #bb895c;
  box-shadow: .15rem .5rem .85rem #432f2945, inset 0 0 0 1px #5b37182a;
  color: #3f281b; font: 600 clamp(1rem, 2.4vw, 1.55rem)/1 Georgia, serif;
}
.sample-engraving { text-shadow: 0 1px #f1c99b; }
.sample-raised { background-color: #52604c; color: #ffe5bc; text-shadow: 1px 2px #222b21; }
.sample-motif { background-color: #d7ad7a; }
.sample-round, .sample-epoxy { width: min(48%, 10rem); aspect-ratio: 1; border-radius: 50%; }
.sample-epoxy { background: linear-gradient(145deg, #c5996d 45%, #3f655a 46%, #233e37 78%); color: #fff0d3; }
.fixed-products { padding: 1.5rem; background: #ebe8dd; }
.fixed-products p { margin-top: .65rem; }
#product-preview { max-width: 34rem; margin-top: 1rem; }
.editor-art { max-height: none; }
.safe-edge { fill: none; stroke: #5a3a1f99; stroke-dasharray: 5 4; pointer-events: none; }
.bordbrikke .safe-edge { stroke: #513117; }
.editor-art { touch-action: none; }
.art-frame { fill: transparent; stroke: #8dd9f5; cursor: grab; }
.art-frame:active { cursor: grabbing; }
.art-handle { fill: #fffdf7; stroke: #1b687d; cursor: nwse-resize; }
.art-handle[data-diagonal="up"] { cursor: nesw-resize; }
.raised-art { filter: drop-shadow(.5px .7px .35px #151e17); }
.art-shape.outside { opacity: .45; }
.position-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
fieldset { min-width: 0; border: 1px solid #cbc8bb; margin: .5rem 0; }
#fixed-product-form { max-width: 30rem; }
textarea { font: inherit; width: 100%; }
#fixed-description { white-space: pre-wrap; }

@media (max-width: 850px) {
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .store-hero, .config-grid { grid-template-columns: 1fr; }
  .store-hero img { height: auto; }
}
@media (max-width: 560px) {
  .catalog { grid-template-columns: 1fr; }
}
.trial-notice {
  margin: 0;
  padding: .65rem 1rem;
  background: #fff2d3;
  color: #302408;
  text-align: center;
}

.site-footer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 4rem; padding-block: 2rem 3rem; border-top: 1px solid #c9c3b4; color: #4e544a; font-size: .92rem; }
.site-footer p { margin: 0 0 .35rem; }
.site-footer .footer-brand { color: #242821; font-weight: 600; }
.site-footer .footer-contact, .site-footer nav { display: flex; flex-direction: column; gap: .35rem; }
.site-footer a { color: inherit; }
.placeholder { background: #ffe58a; color: #3d3100; padding: 0 .2em; border-radius: .2em; }
.placeholder-note { background: #fff4c7; padding: .6rem .8rem; border-radius: .35rem; }
.info-page section { max-width: 70ch; margin-top: 2rem; }
.info-page h3 { margin-top: 1.2rem; font-size: 1.05rem; }
.info-page ol { padding-left: 1.3rem; }
.info-page li { margin-bottom: .4rem; }
.hero-note { font-size: .9rem; opacity: .8; }
#order-receipt ol { padding-left: 1.3rem; }
#order-receipt li { margin-bottom: .4rem; }
.order-comment { white-space: pre-wrap; background: #f3eee3; padding: .5rem .7rem; border-radius: .35rem; }
@media (max-width: 767px) { .site-footer { grid-template-columns: 1fr; } }
.editor-art .raised-art { filter: drop-shadow(1px 1.5px 1px #2a1708aa); stroke: #4a2e18; stroke-width: 1px; vector-effect: non-scaling-stroke; }
