:root {
  --ink: #17333c;
  --muted: #60757c;
  --brand: #00475c;
  --brand-2: #da6756;
  --aqua: #09cad3;
  --sky: #61b3e9;
  --shrimp: #ff7775;
  --orange: #fe5000;
  --herring: #b9c2c2;
  --cream: #f9f6ec;
  --ice: #f3f9fe;
  --line: #d9e4e7;
  --surface: #ffffff;
  --danger: #b3261e;
  --success: #146c43;
  --shadow: 0 18px 55px rgba(0, 71, 92, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(9, 202, 211, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(218, 103, 86, 0.17), transparent 38%),
    var(--cream);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "ff-scala-sans-pro", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.hero {
  padding: 22px 20px 18px;
  background: var(--brand);
  color: #ffffff;
}

.hero.simple {
  padding-bottom: 22px;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-logo {
  width: 164px;
  height: auto;
  display: block;
}

.logo-fallback {
  display: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 22px;
}

.hero h1,
.hero h2 {
  margin: 26px 0 6px;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  font-size: 13px;
  white-space: nowrap;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-area .user-pill {
  max-width: 124px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.content {
  flex: 1;
  padding: 18px 16px 24px;
}

.content.with-bottom {
  padding-bottom: 106px;
}

.field-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--ink);
  font-weight: 750;
}

.input,
.quantity {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

select.input {
  appearance: auto;
}

.input:focus,
.quantity:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(9, 202, 211, 0.16);
}

.helper {
  color: var(--muted);
  font-size: 14px;
}

.notice {
  padding: 13px 14px;
  border-radius: 8px;
  background: var(--ice);
  border: 1px solid #cfe8ef;
  color: var(--brand);
  font-weight: 700;
}

.notice.warn {
  background: #fff4ed;
  border-color: #ffd5c1;
  color: #7d321b;
}

.notice.success {
  background: #edf9f2;
  border-color: #cbead8;
  color: var(--success);
}

.error {
  min-height: 24px;
  color: var(--danger);
  font-weight: 700;
}

.primary,
.secondary,
.ghost,
.danger,
.small-action,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-text {
  gap: 8px;
}

.primary {
  background: var(--brand-2);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(218, 103, 86, 0.24);
}

.secondary {
  background: var(--brand);
  color: #ffffff;
}

.ghost {
  background: #ffffff;
  border: 2px solid var(--line);
  color: var(--brand);
}

.danger {
  background: #fff0ed;
  color: var(--danger);
  border: 2px solid #f1c4bc;
}

.button-stack {
  display: grid;
  gap: 12px;
}

.menu-grid {
  display: grid;
  gap: 14px;
}

.menu-button {
  border: 0;
  border-radius: 8px;
  min-height: 128px;
  padding: 20px;
  text-align: left;
  color: #ffffff;
  background: var(--brand);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 13px 28px rgba(0, 71, 92, 0.16);
}

.menu-button.alt {
  background: var(--brand-2);
}

.menu-button strong {
  font-size: 24px;
  line-height: 1.1;
}

.menu-button span {
  color: rgba(255, 255, 255, 0.84);
}

.summary-strip {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summary-item strong {
  color: var(--brand);
  text-align: right;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.mode-tab {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px 5px;
  font-weight: 850;
  position: relative;
}

.mode-tab span {
  font-size: 12px;
  line-height: 1.1;
}

.mode-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.tab-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-2);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

.history-summary {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ice);
}

.history-summary span {
  color: var(--muted);
  font-size: 14px;
}

.history-summary strong {
  color: var(--brand);
  font-size: 15px;
}

.order-history-list {
  display: grid;
  gap: 10px;
}

.order-history-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.order-history-card summary {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}

.order-history-card summary span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.order-history-card summary strong {
  color: var(--ink);
  font-size: 16px;
}

.order-history-card summary em {
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.order-history-count {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 13px;
  font-weight: 850;
}

.order-history-lines {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 12px 12px;
  list-style: none;
}

.order-history-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.order-history-lines span {
  overflow-wrap: anywhere;
}

.order-history-lines strong {
  color: var(--brand);
  white-space: nowrap;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
}

.toolbar .primary,
.toolbar .ghost,
.toolbar .secondary {
  flex: 1;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 18px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-section {
  display: grid;
  gap: 11px;
}

.order-list {
  display: grid;
  gap: 11px;
}

.line-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 7px solid var(--brand);
  border-radius: 8px;
  padding: 12px;
}

.line-card.has-quantity {
  background: #edf9f2;
  border-color: #b9dfc8;
  border-left-color: var(--success);
}

.line-head {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.line-head > div {
  flex: 1;
  min-width: 0;
}

.line-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.line-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.line-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: end;
  margin-top: 12px;
}

.history-controls {
  grid-template-columns: minmax(0, 1fr) 52px 52px;
}

.cart-controls {
  grid-template-columns: minmax(0, 1fr) 52px 52px;
}

.quantity-box {
  display: grid;
  gap: 5px;
}

.quantity-box label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quantity {
  min-height: 48px;
}

.small-action {
  min-width: 136px;
  background: var(--ice);
  color: var(--brand);
  border: 1px solid #cfe8ef;
}

.small-action.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.line-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.line-actions button {
  flex: 1;
}

.icon-button {
  min-width: 52px;
  background: #ffffff;
  color: var(--danger);
  border: 2px solid #f1c4bc;
}

.icon-action {
  width: 52px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ffffff;
  border: 2px solid var(--line);
  color: var(--brand);
}

.cart-action {
  border-color: #cfe8ef;
  background: var(--ice);
  color: var(--brand);
}

.note-action {
  border-color: #cfe8ef;
  background: var(--ice);
  color: var(--brand);
}

.note-action.active {
  border-color: var(--aqua);
  background: #eafcfd;
  color: var(--brand);
}

.confirm-action {
  border-color: #b7dfcc;
  background: #eefaf3;
  color: var(--success);
}

.danger-action {
  border-color: #f1c4bc;
  background: #fff0ed;
  color: var(--danger);
}

.line-note {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.line-note label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.line-note-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 9px;
  align-items: end;
}

.note-input {
  min-height: 82px;
  line-height: 1.35;
  resize: vertical;
}

.line-note-preview {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--ice);
  border: 1px solid #cfe8ef;
}

.line-note-preview strong {
  color: var(--brand);
  font-size: 13px;
}

.line-note-preview span {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.search-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #ffffff;
}

.search-results {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  margin-top: 10px;
}

.result-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.result-button.selected {
  border-color: var(--aqua);
  background: var(--ice);
}

.result-button strong {
  display: block;
}

.load-more {
  width: 100%;
}

.selected-product {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.selected-summary {
  cursor: default;
}

.bottom-bar {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 10px;
  padding: 12px 16px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 28px rgba(0, 71, 92, 0.09);
}

.bottom-bar.two-actions {
  grid-template-columns: 1fr 1fr;
}

.bottom-bar.two-actions .primary,
.bottom-bar.two-actions .ghost {
  min-height: 54px;
  padding: 10px 8px;
  font-size: 14px;
}

.bottom-feedback {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 850;
  line-height: 1.25;
}

.bottom-feedback.success {
  background: #edf9f2;
  border: 1px solid #b9dfc8;
  color: var(--success);
}

.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cart-add-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.cart-add-links .ghost {
  min-height: 48px;
  padding: 10px 8px;
  font-size: 14px;
}

.mail-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

.empty-state {
  display: grid;
  gap: 14px;
  padding: 22px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.empty-state h3 {
  margin: 0;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.admin-shell .content {
  padding-bottom: 30px;
}

.admin-section {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 13px;
}

.admin-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.admin-card h3 {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.admin-card span {
  color: var(--muted);
  font-size: 14px;
}

.field-stack.compact {
  gap: 10px;
}

.admin-back-link {
  width: 100%;
}

.file-input {
  min-height: 58px;
  padding: 10px;
}

.file-input::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--ice);
  color: var(--brand);
  font-weight: 750;
  cursor: pointer;
}

.import-summary {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
}

.category-fresh { border-left-color: var(--aqua); }
.category-frozen { border-left-color: var(--sky); }
.category-shrimp { border-left-color: var(--shrimp); }
.category-bites { border-left-color: var(--orange); }
.category-smoked { border-left-color: var(--brand-2); }
.category-herring { border-left-color: var(--herring); }
.category-artikel { border-left-color: var(--brand); }

@media (min-width: 680px) {
  body {
    padding: 28px 0;
  }

  .phone-shell {
    min-height: calc(100vh - 56px);
    border-radius: 28px;
    overflow: hidden;
  }

  .screen {
    min-height: calc(100vh - 56px);
  }
}
