@font-face {
  font-family: 'Work Sans';
  src: url('fonts/WorkSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Work Sans';
  src: url('fonts/WorkSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Work Sans';
  src: url('fonts/WorkSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

* {
  margin: 0;
  box-sizing: border-box;
}

button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

body {
  font-family: 'Work Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f0f0;
  color: #000;
}

header h2 {
  color: #999;
}

header {
  background: #3a3a3a;
  color: #f0f0f0;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 200px;
}

.headercontent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

header h1 {
  font-size: 5rem;
  font-weight: 500;
  line-height: 1;
  color: #f0f0f0;
}

header h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 10px;
  color: #f0f0f0;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  margin-top: 40px;
  margin-bottom: 40px;
}

.headercontent {
  width: 100%;
  max-width: 1200px;
  padding: 0 30px;
}

.container {
  width: 100%;
  max-width: 800px;
  margin-left: 20px;
  margin-right: 20px;
}

#palette {
  display: flex;
  height: 400px;
}

#palette.equalshape {
  height: auto;
   align-items: flex-start;
}

#minipalette {
  display: none;
  height: 80px;
}

#minipalette.visible {
  display: flex;
}

#minipalette.equalshape {
  height: auto;
}

#minipalette div {
  flex: 1;
}

#minipalette div.shapeoval {
  border-radius: 50%;
}

#minipalette div.shapesquare,
#minipalette div.shapecircle {
  aspect-ratio: 1;
}

#minipalette div.shapecircle {
  border-radius: 50%;
}

.color {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  position: relative;
  transition: border-radius 0.2s;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.color.shapesquare,
.gallerypreview div.shapesquare {
  aspect-ratio: 1;
  border-radius: 0;
}

.color.shapeoval,
.gallerypreview div.shapeoval {
  border-radius: 50%;
}

.color.shapecircle,
.gallerypreview div.shapecircle {
  aspect-ratio: 1;
  border-radius: 50%;
}

.colorhex {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 14px;
  margin-top: 4px;
  letter-spacing: 1px;
  opacity: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.colorname {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 12px;
  margin-top: 8px;
  letter-spacing: 0.5px;
  opacity: 1;
  padding: 3px 6px;
  text-align: center;
}

.coloractions {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.color:hover .coloractions {
  opacity: 1;
  pointer-events: auto;
}

.coloractions button {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.coloractions button:hover {
  background: rgba(0, 0, 0, 0.95);
}

.wcagbadges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
}

.wcagbadge {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
  cursor: default;
  text-shadow: 0 0 3px rgba(128,128,128,0.4);
  letter-spacing: 0.02em;
}

/* Nudge badges inward for rounded shapes so they stay inside the boundary */
.color.shapeoval .wcagbadges {
  top: 18%;
  right: 12%;
}

.color.shapecircle .wcagbadges {
  top: 20%;
  right: 20%;
}

#controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

#controls button {
  background: #3a3a3a;
  color: #f0f0f0;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
  padding: 12px 24px;
}

#controls button:hover {
  transform: scale(1.02);
}

#controls button:active {
  transform: scale(0.98);
}

#generate:hover {
  transform: scale(1.05);
}

#generate:active {
  transform: scale(0.95);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 20px;
  z-index: 1000;
}

.modal.show {
  display: flex;
}

.modalcontent {
  background: white;
  border-radius: 4px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  margin: auto;
}

.modalcontent h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 24px;
}

.exporttabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin-bottom: 0;
}

.exportmodal {
  max-width: 55vw;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.exportmodal .exportprewrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.exportmodal #cssoutput {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 0;
  scrollbar-gutter: stable;
}

.exportprewrap {
  position: relative;
}

.exportcopybtn,
.modalcontent .exportcopybtn {
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 0 4px 0 0;
  margin: 0;
  min-width: 0;
  width: 2em;
  height: 2em;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exportprewrap:hover .exportcopybtn {
  opacity: 1;
}

.exportcopybtn:hover,
.modalcontent .exportcopybtn:hover {
  color: #d4d4d4;
  opacity: 1;
}

.exporttab {
  background: #2a2a2a;
  color: #666;
  border-top: 1px solid #3e3e42;
  border-left: 1px solid #3e3e42;
  border-right: 1px solid #3e3e42;
  border-bottom: 1px solid #3e3e42;
  border-radius: 4px 4px 0 0;
  margin: 0 -1px -1px 0;
  font-size: 13px;
  line-height: 2;
  min-width: 5em;
  padding: 0 0.75em; /* tab label horizontal breathing room */
  text-align: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.exporttab:hover {
  color: #999;
  z-index: 2;
}

.exporttab.active {
  background: #1e1e1e;
  color: #d4d4d4;
  border-bottom-color: #1e1e1e;
  z-index: 3;
}

.modalcontent pre {
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 0 0 4px 4px;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.8;
  margin: 20px 20px 20px 20px;
  border: 1px solid #3e3e42;
}

.exportmodal pre {
  margin: 0;
  border-radius: 0 0 4px 4px;
  padding-top: 3em; /* breathing room between top border and code text */
  padding-left: 3em; /* breathing room between left border and code text */
}



.modalcontent button:hover {
  opacity: 0.9;
}

.modalcontent,
.modalcontent * {
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a #1a1a1a;
}

.modalcontent ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.modalcontent ::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.modalcontent ::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 3px;
}

.modalcontent ::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Image modal — drop zone */
.imagemodal {
  max-width: 480px;
}

.imagedropzone {
  border: 2px dashed #aaa;
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.imagedropzone:hover,
.imagedropzone.dragover {
  border-color: #555;
  background: rgba(0,0,0,0.04);
}

.imagedropicon {
  font-size: 40px;
  margin-bottom: 12px;
}

.imagedroptext {
  font-size: 16px;
  color: #555;
}

.imagedroptext span {
  font-size: 13px;
  color: #999;
  text-decoration: underline;
}

/* Image preview modal */
.imagepreviewmodal {
  max-width: 700px;
  width: 90%;
}

.imagepreviewlayout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.imagepreviewleft {
  flex: 0 0 220px;
}

.imagepreviewleft img {
  width: 100%;
  border-radius: 6px;
  display: block;
  object-fit: cover;
  max-height: 220px;
}

.imagepreviewright {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.imagepreviewswatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.imagepreviewswatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
  cursor: default;
}

.imagepreviewsliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.imagepreviewactions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.imagepreviewactions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

.imagepreviewactions button:first-child {
  background: #222;
  color: white;
}

.imagepreviewactions button:first-child:hover {
  background: #000;
}

.imagepreviewactions button:last-child {
  background: #eee;
  color: #333;
}

.imagepreviewactions button:last-child:hover {
  background: #ddd;
}

footer {
  background: #3a3a3a;
  color: rgba(240, 240, 240, 0.85);
  padding: 30px 0;
  margin-top: 40px;
  text-align: center;
}

.footercontent {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

.footerlinks {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footerlink {
  background: none;
  border: none;
  color: #f0f0f0;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  font-family: 'Work Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.footerlink:hover {
  background: rgba(240, 240, 240, 0.15);
  transform: translateY(-2px);
}

.footerlink:active {
  transform: translateY(0px);
  background: rgba(240, 240, 240, 0.25);
  transition: all 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

.footertext {
  opacity: 0.9;
  font-size: 14px;
  color: rgba(240, 240, 240, 0.85);
  font-weight: 400;
}

.footertext p {
  margin: 0;
}

.copied {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  padding: 15px 30px;
}

.copied.show {
  opacity: 1;
}

.isolateoverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999;
  cursor: pointer;
}

.isolateoverlay.show {
  display: block;
}

.isolateoverlay.show ~ * {
  position: relative;
  z-index: 1;
}

body.isolateactive #palette,
body.isolateactive #minipalette {
  position: relative;
  z-index: 1000;
}

.historymodal {
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.historymodal h3 {
  flex-shrink: 0;
}

#historylist {
  overflow-y: scroll;
  margin-bottom: 20px;
  flex: 1;
  min-height: 200px;
}

.historyitem {
  background: #f5f5f5;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.historyitem:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.historyitem.current {
  background: #e3f2fd;
  border: 2px solid #2196f3;
  padding: 10px;
}

.historypreview {
  display: flex;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  flex: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.historypreview div {
  flex: 1;
}

.currentlabel {
  font-size: 12px;
  font-weight: 600;
  color: #2196f3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nohistory {
  text-align: center;
  color: #999;
  padding: 40px 20px;
  font-size: 16px;
}

.historybuttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.gallerymodal h3,
.historymodal h3 {
  flex-shrink: 0;
}

#gallerygrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  overflow-y: scroll;
  margin-bottom: 20px;
  padding: 5px;
  flex: 1;
}

.galleryitem {
  background: #f5f5f5;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.galleryitem:hover {
  transform: translateY(-3px);
}

.galleryitem.current {
  background: #e3f2fd;
  border: 2px solid #2196f3;
  padding: 10px;
}

.gallerypreview {
  display: flex;
  height: 120px;
  border-radius: 4px;
  overflow: hidden;
}

.gallerypreview.equalshape {
  height: auto;
}

.gallerypreview div {
  flex: 1;
}

.galleryitem .currentlabel {
  text-align: center;
}

/* Large modals (options, settings, gallery) */
.largemodal .modalcontent {
  max-width: 700px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallerymodal {
  max-width: 1200px;
}

.historymodal {
  max-width: 55vw;
}

.modaldescription {
  color: #666;
  font-size: 14px;
  margin: -10px 0 20px 0;
}

.optionstitlerow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.optionstitlerow h3 {
  margin-bottom: 0;
}

.optionstoprow {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.gearbutton {
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
}

.gearbutton:hover {
  opacity: 1;
}

#settingsmodal .modalcontent,
#optionsmodal .modalcontent {
  height: 85vh;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* Scrollable content areas */
.optionstoggles,
.settingssliders {
  overflow-y: visible;
  margin-bottom: 20px;
}

/* Category sections */
.optionscategory,
.settingscategory {
  margin-bottom: 25px;
}

.optionscategoryheader {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 12px;
  padding-bottom: 6px;
}

.optionscategoryheader h4 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0;
  flex: 1;
}

.optionscategoryarrow {
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
}

.optionscatcheckbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.optionsmodelist {
  display: block;
}

.optionsmodelist.collapsed {
  display: none;
}

.settingssectionbody.collapsed {
  display: none;
}

.settingsdivider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 16px 0;
}

.settingsactionbtn {
  background: rgba(128, 128, 128, 0.15);
  color: inherit;
  font: inherit;
  border: 1px solid currentColor;
  border-radius: 4px;
  cursor: pointer;
  padding: 4px; /* authorized by user */
}

.settingsactionbtn:hover {
  background: rgba(0, 0, 0, 0.12);
}

.optionsmode {
  margin-bottom: 4px;
}

.optionsmoderow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.optionsmoderow input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.optionsmoderow label {
  cursor: pointer;
  flex: 1;
  font-size: 14px;
}

.optionsweighttoggle {
  font-size: 13px;
  cursor: pointer;
  color: #888;
  flex-shrink: 0;
  user-select: none;
}

.optionsweighttoggle:hover {
  color: #3a3a3a;
}

.optionsslider {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding-left: 26px;
}

.optionsslider.expanded {
  display: flex;
}

/* Range input sliders (unified styling) */
.optionsslider input[type="range"],
.settingsslider input[type="range"] {
  flex: 1;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  cursor: pointer;
}

.optionsslider input[type="range"]::-webkit-slider-thumb,
.settingsslider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3a3a3a;
  cursor: pointer;
}

.optionsslider input[type="range"]::-moz-range-thumb,
.settingsslider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3a3a3a;
  cursor: pointer;
  border: none;
}

/* Slider value display */
.optionsslider .slidervalue,
.slidervalue {
  font-size: 14px;
  font-weight: 600;
  color: #3a3a3a;
  min-width: 30px;
  text-align: right;
}

/* Modal action buttons */
.modalbuttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.modalbuttons button,
.historybuttons button {
  flex: 1;
  min-width: 120px;
}

.settingsslider {
  margin-bottom: 16px;
}

.huecheckboxlist {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 8px;
  margin-top: 6px;
}

.cbmodelist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.cbmoderow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.cbmoderow input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.huecheckrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.huecheckrow input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.forcerow {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.forcerow input[type="color"] {
  width: 40px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
}

.forcedlist {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forceditem {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.forcedswatchsmall {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

.forcedhex {
  flex: 1;
  font-size: 12px;
  letter-spacing: 1px;
}

.forcedclear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #888;
}

.forcedclear:hover {
  color: #3a3a3a;
}

.nonetext {
  font-size: 13px;
  color: #888;
}

.sliderlabel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sliderlabel strong {
  font-size: 14px;
  font-weight: 600;
}

/* Info Modal Styles (About, Story, Contact, Help, Coffee, Tracking, Legal) */
.infomodal .modalcontent {
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
}

.infomodal .modalheader {
  position: relative;
  padding: 20px 30px;
  border-bottom: 1px solid #ddd;
}

.infomodal .modalheader h2 {
  margin: 0;
  font-size: 1.8em;
}

.infomodal .modalbody {
  padding: 30px;
  line-height: 1.7;
}

.infomodal .modalbody h2,
.infomodal .modalbody h3,
.infomodal .modalbody h4 {
  margin-top: 0;
  margin-bottom: 15px;
}

.infomodal .modalbody p {
  margin-bottom: 15px;
}

.infomodal .modalbody ul {
  margin: 10px 0 15px 20px;
  padding: 0;
}

.infomodal .modalbody li {
  margin-bottom: 8px;
}

/* Centered content variant */
.centeredcontent {
  text-align: center;
}

.centeredcontent p {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Modal footer note */
.modalfooternote {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  font-size: 0.9em;
}

/* Contact modal specific */
.contactbuttoncontainer {
  margin: 30px 0;
}

.contactbtn {
  display: inline-block;
  padding: 15px 30px;
  background-color: #569cd6;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.contactbtn:hover {
  background-color: #4a8cc7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(86, 156, 214, 0.3);
}

.contactnote {
  margin-top: 20px;
  font-size: 0.9em;
}

.coffeebtn {
  display: inline-block;
  background: #FF6B35;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
}

.coffeebtn:hover {
  background: #FF8E35;
  color: white;
}

/* Help modal specific */
.helpcontent {
  max-height: calc(85vh - 80px);
  overflow-y: auto;
}

.helpsection {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.helpsection:last-child {
  border-bottom: none;
}

.helpsection h3 {
  font-size: 1.3em;
  margin-bottom: 15px;
  color: #569cd6;
}

.helpsection h4 {
  font-size: 1.1em;
  margin: 15px 0 10px 0;
}

/* Coffee modal specific */
.coffeecontent {
  padding: 40px 30px !important;
}

.coffeehero {
  margin-bottom: 30px;
}

.coffeeemoji {
  font-size: 4em;
  margin-bottom: 15px;
}

.coffeehero h2 {
  font-size: 2em;
  margin-bottom: 10px;
  color: #333;
}

.coffeehero p {
  font-size: 1.1em;
  color: #666;
}

.coffeeinfo {
  background-color: #f8f8f8;
  padding: 20px;
  border-radius: 8px;
  margin: 25px 0;
  text-align: left;
}

.coffeeinfo h4 {
  margin-top: 0;
  color: #333;
}

.coffeeinfo ul {
  margin: 10px 0 0 20px;
  padding: 0;
}

.coffeeinfo li {
  margin-bottom: 8px;
}

.coffeesupport {
  margin-top: 25px;
}

.coffeebuttons {
  margin: 20px 0;
}

.btncoffee {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 30px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btncoffee:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Legal disclaimer box */
.legaldisclaimer {
  background-color: #f8f8f8;
  padding: 20px;
  border-radius: 5px;
  border-left: 4px solid #569cd6;
  margin: 20px 0;
}

.legaldisclaimer p {
  margin-bottom: 12px;
}

.legaldisclaimer p:last-child {
  margin-bottom: 0;
}

/* =============================================================================
   Dark Mode
   Applied when .darkmode is on <html>
   ============================================================================= */

.darkmode body {
  background: #1a1a1a;
  color: #e0e0e0;
}

.darkmode #controls button {
  background: #e0e0e0;
  color: #3a3a3a;
}

.darkmode .exporttab {
  background: #222;
  color: #666;
}

.darkmode .exporttab.active {
  background: #1e1e1e;
  color: #d4d4d4;
}

.darkmode .modalcontent {
  background: #2a2a2a;
  color: #e0e0e0;
}

.darkmode .optionsmoderow label {
  color: #e0e0e0;
}

.darkmode .optionsweighttoggle {
  color: #aaa;
}

.darkmode .optionsweighttoggle:hover {
  color: #e0e0e0;
}

.darkmode .optionsslider input[type="range"] {
  background: #444;
}

.darkmode .optionsslider input[type="range"]::-webkit-slider-thumb {
  background: #e0e0e0;
}

.darkmode .optionsslider input[type="range"]::-moz-range-thumb {
  background: #e0e0e0;
}

.darkmode .optionsslider .slidervalue {
  color: #e0e0e0;
}

.darkmode .optionscategoryheader h4 {
  color: #e0e0e0;
}

.darkmode .optionscategoryheader {
  border-bottom-color: #555;
}

.darkmode .optionscategoryarrow {
  color: #aaa;
}

.darkmode .settingsslider input[type="range"] {
  background: #444;
}

.darkmode .historyitem {
  background: #2a2a2a;
}

.darkmode .historyitem.current {
  background: #1a3a52;
  border-color: #64b5f6;
}

.darkmode .galleryitem {
  background: #2a2a2a;
}

.darkmode .galleryitem.current {
  background: #1a3a52;
  border-color: #64b5f6;
}

@media (max-width: 768px) {
  #gallerygrid {
    grid-template-columns: 1fr;
  }
  
  .infomodal .modalcontent {
    max-width: 95%;
    margin: 20px auto;
  }
  
  .infomodal .modalbody {
    padding: 20px;
  }
  
  .coffeecontent {
    padding: 30px 20px !important;
  }
  
  .coffeeemoji {
    font-size: 3em;
  }
  
  .coffeehero h2 {
    font-size: 1.5em;
  }
}

@media (max-width: 768px) {
  header {
    min-height: 100px;
    padding-top: 0;
  }
  
  .headercontent {
    padding: 0 20px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  header h2 {
    font-size: 1rem;
  }
}
