
body {
  font-family: 'Ubuntu', sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  background: #f5f7fb;
  color: #1f2937;
}

.app-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 18px 12px;
  text-align: center;
  color: white;
  margin-bottom: 10px;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
}

.app-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
}

.app-subtitle {
  font-size: 16px;
  margin: 6px 0 0;
  opacity: 0.95;
}

.converter-container {
  padding: 20px;
  display: flex;
  justify-content: center;
}

.converter-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 35px;
  width: 100%;
  max-width: 1120px;
  box-sizing: border-box;
}

.converter-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
  color: #1f2937;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* force true split layout on desktop/laptop */
.converter-form.split-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.controls-panel,
.results-panel {
  min-width: 0;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0;
}

/* Custom Select Styles */
.custom-select-wrapper {
  position: relative;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  line-height: 1.5;
  min-height: 58px;
  box-sizing: border-box;
}

.custom-select-trigger:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.custom-select.open .custom-select-trigger {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: #f9fafb;
}

.select-arrow {
  width: 24px;
  height: 24px;
  color: #667eea;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 10px;
}

.custom-select.open .select-arrow {
  transform: rotate(180deg);
}

.custom-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.custom-select.open .custom-options {
  max-height: 320px;
  opacity: 1;
  overflow-y: auto;
}

.custom-option {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
}

.custom-option:hover {
  background-color: #f3f4f6;
  color: #667eea;
}

.custom-option.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

.converter-input {
  padding: 14px 16px;
  font-size: 20px;
  font-weight: 600;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: white;
  line-height: 1.4;
  color: #1f2937;
  box-sizing: border-box;
}

.converter-input:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.converter-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: white;
}

/* shorter quantity field only */
#inputValue {
  width: 220px;
  max-width: 100%;
}

.results-panel {
  display: flex;
}

.result-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 35px 30px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
  width: 100%;
  box-sizing: border-box;
  margin-top: 0;
}

.result-label {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.result-inline {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-value {
  color: white;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.result-unit {
  color: rgba(255, 255, 255, 0.95);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 0;
}

.formula-row {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.conversion-formula {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  font-style: italic;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  display: inline-block;
  backdrop-filter: blur(10px);
}

/* Scrollbar styling for dropdown */
.custom-options::-webkit-scrollbar {
  width: 8px;
}

.custom-options::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.custom-options::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Responsive */
@media (min-width: 768px) and (max-width: 1024px) {
  .converter-card {
    padding: 30px;
  }

  .converter-title {
    font-size: 28px;
  }

  .result-value {
    font-size: 44px;
  }
}

@media (max-width: 767px) {
  .converter-card {
    padding: 24px;
  }

  .converter-title {
    font-size: 24px;
    margin-bottom: 24px;
  }

  .converter-form.split-layout {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .result-value {
    font-size: 40px;
  }

  .result-unit {
    font-size: 18px;
  }

  .conversion-formula {
    font-size: 12px;
    padding: 8px 16px;
  }

  .custom-select-trigger {
    font-size: 15px;
    padding: 14px 16px;
  }

  .custom-option {
    font-size: 14px;
    padding: 12px 16px;
  }

  #inputValue {
    width: 100%;
    max-width: 220px;
  }
}


/* Ver-0012 smaller desktop controls */
@media (min-width: 768px) {

  .custom-select-trigger {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 46px;
  }

  .custom-option {
    padding: 10px 14px;
    font-size: 14px;
  }

  .converter-input {
    padding: 10px 12px;
    font-size: 16px;
  }

  #inputValue {
    width: 160px;
  }

  .form-label {
    font-size: 12px;
  }

}


/* Ver-0013 utility controls */
.utility-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

.preference-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
}

.preference-label, .copy-feedback {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.utility-btn, .copy-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.28);
}

.utility-btn:hover, .copy-btn:hover {
  transform: translateY(-1px);
}

.copy-row {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: .25s;
}

.slider:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 4px;
  background: white;
  border-radius: 50%;
  transition: .25s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.switch input:checked + .slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.switch input:checked + .slider:before {
  transform: translateX(24px);
}

@media (max-width: 767px) {
  .utility-row {
    margin-bottom: 10px;
  }
  .preference-label {
    width: 100%;
  }
}


/* Ver-0016 preference bar above card and desktop restore */
.global-preference-bar {
  padding: 12px 20px 4px;
}

.global-preference-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.global-preference-inner .preference-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
}

.global-preference-inner .preference-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.results-panel {
  display: flex;
  flex-direction: column;
}

.swap-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

@media (max-width: 767px) {
  .global-preference-bar {
    padding: 10px 16px 0;
  }

  .global-preference-inner {
    justify-content: flex-start;
    align-items: center;
  }
}


/* Ver-0019 settings cleanup */
.header-content {
  position: relative;
}

.settings-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.16);
  color: white;
  backdrop-filter: blur(8px);
}

.settings-btn:hover {
  background: rgba(255,255,255,0.24);
}

.settings-panel.hidden {
  display: none;
}

.settings-panel {
  padding: 14px 20px 0;
}

.settings-card {
  max-width: 1120px;
  margin: 0 auto 8px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  padding: 18px 20px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.settings-title {
  margin: 0;
  font-size: 20px;
  color: #1f2937;
}

.settings-close {
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}

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

.settings-label {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.settings-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-option {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.settings-help {
  font-size: 13px;
  color: #6b7280;
}

.swap-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

@media (max-width: 767px) {
  .settings-btn {
    position: static;
    transform: none;
    margin-top: 10px;
  }

  .header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}


/* Ver-0020 swap icon beside result + settings fix */
.result-value {
  font-size: 60px !important;
}

.swap-icon-btn {
  border: 0;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Ubuntu', sans-serif;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.16);
  color: white;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  margin-left: 6px;
  vertical-align: middle;
}

.swap-icon-btn:hover {
  background: rgba(255,255,255,0.24);
  transform: translateY(-1px);
}

.settings-panel {
  display: block;
  position: relative;
  z-index: 50;
}

.settings-panel.hidden {
  display: none !important;
}

.settings-btn {
  z-index: 60;
}

@media (max-width: 767px) {
  .result-value {
    font-size: 46px !important;
  }

  .swap-icon-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}


/* Ver-0021 settings fix + swap beside formula */
.results-panel {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-inline {
  justify-content: center;
  width: 100%;
}

.formula-row {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.formula-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.conversion-formula {
  margin: 0 !important;
}

.swap-icon-btn {
  margin-left: 0;
  flex-shrink: 0;
}

.settings-panel.hidden {
  display: none !important;
}

.settings-panel:not(.hidden) {
  display: block !important;
}

@media (max-width: 767px) {
  .formula-inline {
    gap: 10px;
  }
}


/* Ver-0022 improved mobile header spacing */
@media (max-width: 767px){

.header-content{
padding-top:16px;
padding-bottom:18px;
}

.header-content h1{
margin-top:10px;
margin-bottom:6px;
}

.header-content p{
margin-bottom:14px;
}

.settings-btn{
margin-bottom:8px;
}

}


/* Ver-0023 theme support */
:root {
  --page-bg: #f5f7fb;
  --text-main: #1f2937;
  --card-bg: #ffffff;
  --muted-text: #6b7280;
  --control-bg: #ffffff;
  --control-hover: #f9fafb;
  --control-border: #e5e7eb;
  --option-text: #374151;
  --settings-card-bg: #ffffff;
  --settings-help: #6b7280;
}

body {
  background: var(--page-bg) !important;
  color: var(--text-main) !important;
}

.converter-card,
.settings-card {
  background: var(--card-bg) !important;
}

.settings-card {
  background: var(--settings-card-bg) !important;
}

.form-label,
.settings-label,
.preference-title,
.settings-help,
.settings-option,
.app-subtitle {
  color: var(--muted-text) !important;
}

.custom-select-trigger,
.converter-input {
  background: var(--control-bg) !important;
  border-color: var(--control-border) !important;
  color: var(--text-main) !important;
}

.custom-select-trigger:hover,
.converter-input:hover {
  background: var(--control-hover) !important;
}

.custom-option {
  color: var(--option-text) !important;
}

.custom-options {
  background: var(--card-bg) !important;
  border-color: var(--control-border) !important;
}

.settings-title,
.converter-title {
  color: var(--text-main);
}

body.dark-theme {
  --page-bg: #0f172a;
  --text-main: #e5e7eb;
  --card-bg: #111827;
  --muted-text: #cbd5e1;
  --control-bg: #1f2937;
  --control-hover: #243042;
  --control-border: #374151;
  --option-text: #e5e7eb;
  --settings-card-bg: #111827;
  --settings-help: #cbd5e1;
}

body.dark-theme .converter-title {
  background: none;
  -webkit-text-fill-color: unset;
  color: #c4b5fd;
}

body.dark-theme .settings-btn {
  background: rgba(255,255,255,0.12);
}

body.dark-theme .settings-close {
  color: #cbd5e1;
}


/* Ver-0024 settings/theme visibility fixes */
.app-subtitle {
  color: rgba(255, 255, 255, 0.92) !important;
}

body.dark-theme .app-subtitle {
  color: rgba(255, 255, 255, 0.92) !important;
}

.settings-card .settings-item + .settings-item {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(107,114,128,0.18);
}

#themeLabel,
#unitPreferenceLabel {
  display: block;
}

.settings-card {
  overflow: visible;
}


/* Ver-0026 theme + settings JS fix */
:root{
  --bg-page:#f5f7fb;
  --bg-card:#ffffff;
  --text-main:#1f2937;
  --text-muted:#6b7280;
  --text-soft:#374151;
  --border-ui:#e5e7eb;
  --bg-input:#ffffff;
  --bg-input-hover:#f9fafb;
  --bg-dropdown:#ffffff;
  --shadow-card:0 8px 24px rgba(0, 0, 0, 0.12);
}

body{
  background:var(--bg-page) !important;
  color:var(--text-main) !important;
}

.converter-card,
.settings-card{
  background:var(--bg-card) !important;
  box-shadow:var(--shadow-card) !important;
}

.form-label,
.settings-label,
.settings-help,
.settings-option,
.custom-option{
  color:var(--text-muted) !important;
}

.custom-select-trigger,
.converter-input,
.custom-options{
  background:var(--bg-input) !important;
  border-color:var(--border-ui) !important;
  color:var(--text-main) !important;
}

.custom-select-trigger:hover,
.converter-input:hover{
  background:var(--bg-input-hover) !important;
}

.custom-options{
  background:var(--bg-dropdown) !important;
}

.app-subtitle{
  color: rgba(255, 255, 255, 0.92) !important;
}

body.dark-theme{
  --bg-page:#0f172a;
  --bg-card:#111827;
  --text-main:#e5e7eb;
  --text-muted:#cbd5e1;
  --text-soft:#e5e7eb;
  --border-ui:#374151;
  --bg-input:#1f2937;
  --bg-input-hover:#243042;
  --bg-dropdown:#1f2937;
  --shadow-card:0 10px 28px rgba(0, 0, 0, 0.35);
}

body.dark-theme .converter-title{
  background:none !important;
  -webkit-text-fill-color:unset !important;
  color:#c4b5fd !important;
}

body.dark-theme .settings-title{
  color:#e5e7eb !important;
}

body.dark-theme .settings-close{
  color:#cbd5e1 !important;
}

body.dark-theme .app-subtitle{
  color: rgba(255, 255, 255, 0.92) !important;
}


/* Ver-0028 layout fix after removing card title */
.converter-card {
  padding-top: 24px !important;
}

.converter-form {
  margin-top: 0 !important;
}

@media (max-width: 767px) {
  .converter-card {
    padding-top: 18px !important;
  }
}


/* Ver-0032 working popup selectors */
.custom-select-wrapper,
.custom-select,
.custom-options,
.custom-option,
.custom-select-trigger,
.select-arrow {
  display: none !important;
}

.selector-button {
  width: 100%;
  border: 2px solid var(--border-ui, #e5e7eb);
  background: var(--bg-input, #fff);
  color: var(--text-main, #1f2937);
  border-radius: 12px;
  min-height: 60px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  text-align: left;
}

.selector-button:hover {
  background: var(--bg-input-hover, #f9fafb);
}

.selector-arrow {
  display: inline-block !important;
  font-size: 28px;
  line-height: 1;
  color: #667eea;
  transform: rotate(90deg);
  flex-shrink: 0;
}

.form-label {
  font-size: 14px !important;
}

.selector-modal.hidden { display: none !important; }
.selector-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.selector-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.selector-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  background: var(--bg-card, #fff);
  color: var(--text-main, #1f2937);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.selector-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(107,114,128,0.15);
}
.selector-sheet-title { margin: 0; font-size: 22px; }
.selector-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
}
.selector-search-wrap { padding: 14px 20px 8px; }
.selector-search {
  width: 100%;
  border: 2px solid var(--border-ui, #e5e7eb);
  background: var(--bg-input, #fff);
  color: var(--text-main, #1f2937);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 15px;
  box-sizing: border-box;
}
.selector-list { padding: 6px 12px 16px; overflow: auto; }
.selector-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main, #1f2937);
  font-family: 'Ubuntu', sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  padding: 14px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: block;
}
.selector-item:hover { background: rgba(102,126,234,0.08); }
.selector-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}
body.modal-open { overflow: hidden; }

@media (max-width: 767px) {
  .selector-button { font-size: 17px; min-height: 58px; }
  .selector-sheet {
    left: 0; right: 0; bottom: 0; top: auto; transform: none;
    width: 100%; max-height: 85vh; border-radius: 22px 22px 0 0;
  }
}


/* Ver-0033 polished popup style */
.selector-modal-backdrop {
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(6px);
}

.selector-sheet {
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 28px 70px rgba(0,0,0,0.34);
}

.selector-sheet-header {
  padding: 20px 22px 14px;
  background: linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.08) 100%);
}

.selector-sheet-title {
  font-size: 24px;
  font-weight: 700;
}

.selector-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(102,126,234,0.08);
  transition: all 0.2s ease;
}

.selector-close:hover {
  background: rgba(102,126,234,0.16);
  transform: rotate(90deg);
}

.selector-search-wrap {
  padding: 16px 22px 10px;
}

.selector-search {
  font-size: 16px;
  min-height: 52px;
  padding: 13px 16px;
  border-radius: 14px;
}

.selector-search:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102,126,234,0.12);
}

.selector-list {
  padding: 8px 14px 18px;
}

.selector-item {
  padding: 16px 16px;
  border-radius: 14px;
  margin-bottom: 6px;
  transition: all 0.18s ease;
  position: relative;
}

.selector-item:hover {
  background: rgba(102,126,234,0.10);
  transform: translateX(2px);
}

.selector-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 8px 18px rgba(102,126,234,0.28);
}



body.dark-theme .selector-sheet-header {
  background: linear-gradient(135deg, rgba(102,126,234,0.16) 0%, rgba(118,75,162,0.16) 100%);
}

body.dark-theme .selector-close {
  background: rgba(255,255,255,0.08);
  color: #e5e7eb;
}

body.dark-theme .selector-close:hover {
  background: rgba(255,255,255,0.14);
}

@media (max-width: 767px) {
  .selector-sheet {
    box-shadow: 0 -10px 34px rgba(0,0,0,0.26);
  }

  .selector-sheet-header {
    padding: 18px 18px 12px;
  }

  .selector-sheet-title {
    font-size: 22px;
  }

  .selector-search-wrap {
    padding: 14px 18px 8px;
  }

  .selector-list {
    padding: 8px 10px 16px;
  }

  .selector-item {
    font-size: 17px;
    padding: 16px 14px;
  }
}


/* Ver-0035 favourites in popup */
.selector-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted, #6b7280);
  padding: 10px 14px 6px;
}

.selector-divider {
  height: 1px;
  background: rgba(107,114,128,0.15);
  margin: 8px 10px 10px;
}

.selector-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.selector-item-label {
  flex: 1;
  min-width: 0;
}

.favourite-btn {
  border: 0;
  background: transparent;
  color: #9ca3af;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.favourite-btn:hover {
  background: rgba(102,126,234,0.08);
  color: #667eea;
}

.favourite-btn.active {
  color: #f59e0b;
}

body.dark-theme .favourite-btn {
  color: #94a3b8;
}

body.dark-theme .favourite-btn.active {
  color: #fbbf24;
}


/* Ver-0037 favourites UI cleanup */
.selector-item-row{
  display:flex;
  align-items:center;
  width:100%;
}

.selector-item-label{
  flex:1;
}

.favourite-btn{
  margin-left:auto;
  padding-left:14px;
  font-size:22px;
}

.selector-item{
  padding-right:24px;
}



/* Ver-0038 modern favourite icon with micro-animation */
.favourite-btn {
  margin-left: auto;
  padding-left: 14px;
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  transition: transform 120ms ease, color 120ms ease, text-shadow 120ms ease;
  transform-origin: center;
}

.favourite-btn:hover {
  color: #667eea;
  transform: scale(1.06);
}

.favourite-btn.active {
  color: #f59e0b;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.18);
}

.favourite-btn.pop {
  animation: favourite-pop 140ms ease;
}

@keyframes favourite-pop {
  0%   { transform: scale(0.92); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

body.dark-theme .favourite-btn {
  color: #94a3b8;
}

body.dark-theme .favourite-btn.active {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.22);
}


/* Ver-0039 favourite cleanup */
.favourite-btn {
  position: relative;
  min-width: 28px;
  text-align: center;
}

.favourite-btn.pop {
  animation: favourite-pop 220ms ease;
}



/* Ver-0040 stronger favourite animation */
.favourite-btn {
  transition: transform 160ms ease, color 160ms ease, text-shadow 160ms ease, filter 160ms ease;
}

.favourite-btn.pop {
  animation: favourite-pop-strong 320ms ease;
}

@keyframes favourite-pop-strong {
  0%   { transform: scale(0.88); filter: brightness(1); }
  35%  { transform: scale(1.28); filter: brightness(1.18); }
  65%  { transform: scale(1.12); filter: brightness(1.08); }
  100% { transform: scale(1); filter: brightness(1); }
}


/* Ver-0041 PWA finalisation */
.install-btn.hidden,
.install-banner.hidden {
  display: none !important;
}

.install-btn {
  position: absolute;
  right: 132px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.16);
  color: white;
  backdrop-filter: blur(8px);
}

.install-btn:hover {
  background: rgba(255,255,255,0.24);
}

.install-banner {
  padding: 10px 20px 6px;
}

.install-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  background: rgba(102,126,234,0.10);
  border: 1px solid rgba(102,126,234,0.18);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.install-banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-main, #1f2937);
}

.install-banner-text strong {
  font-size: 15px;
}

.install-banner-text span {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
}

.install-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.install-banner-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.70);
  color: var(--text-main, #1f2937);
}

.install-banner-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

body.dark-theme .install-banner-inner {
  background: rgba(102,126,234,0.12);
  border-color: rgba(102,126,234,0.24);
}

body.dark-theme .install-banner-btn {
  background: rgba(255,255,255,0.08);
  color: #e5e7eb;
}

@media (max-width: 767px) {
  .install-btn {
    position: static;
    transform: none;
    margin-top: 8px;
  }

  .install-banner {
    padding: 10px 16px 4px;
  }

  .install-banner-inner {
    align-items: flex-start;
  }

  .install-banner-actions {
    width: 100%;
  }
}


/* Ver-0042 deduped conversion rows with inline swap */
.selector-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.selector-item-label {
  flex: 1;
  min-width: 0;
}

.selector-row-swap {
  border: 0;
  background: rgba(102,126,234,0.08);
  color: #667eea;
  border-radius: 10px;
  padding: 6px 8px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.selector-row-swap:hover {
  background: rgba(102,126,234,0.16);
}

body.dark-theme .selector-row-swap {
  background: rgba(255,255,255,0.08);
  color: #c4b5fd;
}

body.dark-theme .selector-row-swap:hover {
  background: rgba(255,255,255,0.14);
}


/* Ver-0043 info pages + footer */
.app-footer {
  padding: 10px 16px 30px;
}

.app-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: #6b7280;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.info-page-wrap {
  padding: 20px;
  display: flex;
  justify-content: center;
}

.info-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 32px;
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
}

.info-card h1 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 2rem;
}

.info-card h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.info-card h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 1rem;
}

.info-card p,
.info-card li {
  line-height: 1.65;
}

.info-card ul {
  padding-left: 22px;
}

.info-card a {
  color: #5b58d6;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-weight: 600;
  text-decoration: none;
}

.version-note {
  color: #6b7280;
}

@media (max-width: 640px) {
  .info-card {
    padding: 24px 20px;
  }

  .app-footer-inner {
    justify-content: center;
    text-align: center;
  }
}


/* Ver-0044 footer placement fix */
.app-footer {
  width: 100%;
  box-sizing: border-box;
}

.app-footer-inner {
  justify-content: center;
  text-align: center;
}

.footer-version {
  white-space: nowrap;
}


/* Ver-0045 polish */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.converter-container,
.info-page-wrap {
  flex: 1;
}

.converter-card {
  border: 1px solid rgba(102, 126, 234, 0.08);
}

.result-container {
  min-height: 100%;
}

.app-footer {
  margin-top: 8px;
  padding: 8px 16px 28px;
}

.footer-version {
  font-weight: 700;
}

.footer-links {
  justify-content: center;
}

.footer-links a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(102,126,234,0.08);
}

.footer-links a:hover {
  background: rgba(102,126,234,0.14);
  text-decoration: none;
}

body.dark-theme .footer-links a {
  background: rgba(255,255,255,0.08);
}

body.dark-theme .footer-links a:hover {
  background: rgba(255,255,255,0.14);
}

@media (max-width: 767px) {
  .converter-container {
    padding: 14px;
  }

  .converter-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .footer-links a {
    padding: 7px 11px;
    font-size: 0.92rem;
  }
}


/* Ver-0046 cooking additions */


/* Ver-0049 splash + install UX */
.splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  color: #fff;
  padding: 24px;
}

.splash-icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 18px;
}

.splash-title {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 6px;
}

.splash-subtitle {
  font-size: 16px;
  opacity: 0.95;
}

.settings-install-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-install-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 8px 18px rgba(102, 126, 234, 0.25);
}

.settings-install-btn[disabled] {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.install-instructions {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f5f7fb;
  color: #4b5563;
  line-height: 1.5;
}

.install-instructions p {
  margin: 0 0 8px;
}

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

.dark-theme .install-instructions {
  background: rgba(255,255,255,0.06);
  color: #d1d5db;
}

@media (max-width: 640px) {
  .splash-icon {
    width: 82px;
    height: 82px;
    border-radius: 20px;
  }

  .splash-title {
    font-size: 30px;
  }

  .settings-install-btn {
    width: 100%;
  }
}


/* Ver-0051 splash timing 4s */
.splash-content {
  max-width: 340px;
}

.splash-subtitle {
  font-size: 16px;
  opacity: 0.96;
}

.splash-funline {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0.88;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  display: inline-block;
  backdrop-filter: blur(8px);
}

.app-footer {
  padding-bottom: 38px;
}

.footer-version {
  font-weight: 700;
}

@media (max-width: 767px) {
  .splash-icon {
    width: 88px;
    height: 88px;
  }

  .splash-title {
    font-size: 30px;
  }

  .splash-subtitle {
    font-size: 15px;
  }

  .splash-funline {
    font-size: 13px;
    padding: 9px 12px;
  }
}
