:root {
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'Roboto Mono', Consolas, monospace;
  --bg: #eef3f6;
  --panel: #ffffff;
  --panel-soft: #f6f9fb;
  --text: #16313a;
  --text-muted: #292f33;
  --border: #90c7c2;
  --accent: #0f766e;
  --accent-2: #d97706;
  --success: #146b60;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, .08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, #e7eef3 100%);
}

button,
input,
textarea {
  font: inherit;
  border: 0;
  outline: 0;
}

.page-shell {
  max-width: 1000px;
  margin: 12px auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.calculator-card,
.chart-card {
  background: linear-gradient(180deg, rgba(255,255,255,.9), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.calculator-card {
  padding: 14px;
}

.chart-card {
  padding: 12px;
}

.hero-block {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #308881;
}

.hero-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.eyebrow,
.status-pill,
.section-caption,
.chart-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow,
.section-caption {
  color: var(--accent);
}

.status-pill,
.chart-badge {
  padding: 3px 9px;
  border: 1px solid rgba(22,49,58,.08);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255,255,255,.85);
}

.hero-block h1 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 12px;
  align-items: start;
}

.section-caption {
  display: block;
  margin-bottom: 2px;
}

.form-table {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 92px 64px;
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(22,49,58,.04);
}

.table-head {
  padding: 5px 8px;
  background: #f4f8fb;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-align: center;
}

.table-head:first-child {
  text-align: left;
  padding-left: 12px;
}

.row-label {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: #fff;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 6px;
  background: #ffffff;
}

.field input {
  width: 100%;
  height: 34px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid #6d7e7c1a;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  text-align: center;
  font-family: var(--font-mono);
  transition: .14s ease;
}

.field input::placeholder {
  color:#79bbb5;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(204, 49, 83, 0.08);
}

.field label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 5px;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: .12s ease;
  background: #ffffff;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 7px;
  opacity: 1;
}

.field-error input {
  color: var(--accent-2);
  font-weight: 500;
  text-align: center;
}

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

button {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  touch-action: manipulation;
}

#Calculation {
  width: 160px;
  background: linear-gradient(180deg, #113531, #123d3a);
  color: #fff;
}

#reset {
  width: 100px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(22,49,58,.08);
}

.result-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-block {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(22,49,58,.06);
  background: linear-gradient(180deg, #fff, var(--panel-soft));
}

.panel-result {
  background: #f2fbfa;
  border-color: rgba(49, 94, 90, 0.12);
}

.panel-block .section-caption {
  margin-bottom: 8px;
}

#out,
#outct {
  width: 100%;
  height: 290px;
  resize: none;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(15,118,110,.10);
  background: #fff;
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.25;
}

.calc-description {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: justify;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.chart-area {
  width: 100%;
  min-height: 395px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fbfdfe, #f2f7fa);
  border: 1px solid rgba(22,49,58,.05);
  overflow: hidden;
}

.chart-area svg {
  display: block;
  width: 100%;
  height: auto;
}

/* === TIME CARD STYLES === */
.time-card {
  padding: 12px;
}

.time-form {
  margin-bottom: 12px;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 1.2fr auto;
  gap: 10px;
  align-items: end;
}

.time-row .field {
  min-width: 100px;
}

#Time_conc {
  height: 40px;
  padding: 0 16px;
  white-space: nowrap;
  background: linear-gradient(180deg, #113531, #123d3a);
  color: #fff;
}

.time-result-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.chart-card-inner {
  background: linear-gradient(180deg, rgba(255,255,255,.9), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

/* === MEDIA QUERIES === */
@media (max-width: 900px) {
  .page-shell {
    padding: 8px;
    margin: 8px auto;
  }

  .calc-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-table {
    grid-template-columns: 1fr;
    gap: 8px;
    background: transparent;
    overflow: visible;
  }

  .table-head,
  .table-empty {
    display: none !important;
  }

  .row-label {
    padding: 8px 10px;
    font-size: 13px;
    background: rgba(22,49,58,.04);
    border-radius: 6px;
  }

  .field {
    padding: 8px 10px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid rgba(22,49,58,.08);
  }

  .action-row {
    flex-direction: column;
  }

  button {
    width: 100%;
    height: 42px;
    touch-action: manipulation;
  }

  #Calculation,
  #reset,
  #Time_conc {
    width: 100%;
  }

  #out,
  #outct {
    height: 200px;
    font-size: 13px;
  }

  .chart-area {
    min-height: 280px;
  }

  .calculator-card,
  .chart-card {
    padding: 10px;
  }

  .hero-block h1 {
    font-size: 16px;
  }

  input,
  textarea {
    font-size: 16px;
  }

  .hero-meta {
    flex-wrap: wrap;
  }

  .panel-block {
    padding: 10px;
  }

  .calc-description {
    font-size: 13px;    
  }

  .time-row {
    grid-template-columns: 1fr;
  }

  .time-result-layout {
    grid-template-columns: 1fr;
  }
}