.age-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 420px 1fr 280px;
  gap: 0;
  min-height: 0;
}

.age-panel,
.age-side {
  background: var(--surface);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.age-panel { border-right: 1px solid var(--border); }
.age-side { border-left: 1px solid var(--border); }

.age-main {
  padding: 22px 22px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.04), transparent 42%), var(--bg);
}

section {
  padding: 14px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text3);
  margin-bottom: 10px;
}

.section-label-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hint-text {
  font-size: 12px;
  color: var(--text3);
  margin-top: 8px;
  line-height: 1.65;
}

.hint-text--warn {
  color: #ef4444;
  font-weight: 600;
}

.mode-row {
  display: flex;
  gap: 8px;
}

.mode-btn {
  flex: 1;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-weight: 500;
  font-size: 13px;
}

.mode-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.mode-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 8px;
}

.text-input {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.text-input--readonly {
  cursor: default;
  background: var(--surface-muted);
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.select {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.select--compact {
  padding-top: 8px;
  padding-bottom: 8px;
}

.calendar-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.age-calendar-host {
  margin-top: 12px;
  width: 100%;
}

.age-calendar-host.jsCalendar {
  display: block;
  width: 100% !important;
  max-width: none !important;
}

.age-calendar-host.jsCalendar table {
  width: 100% !important;
  max-width: none !important;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: none;
  overflow: hidden;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
}

.age-calendar-host.jsCalendar thead {
  display: table-header-group !important;
  width: auto !important;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.92), rgba(6, 182, 212, 0.88));
}

.age-calendar-host.jsCalendar thead .jsCalendar-title-name {
  display: block;
  position: absolute;
  left: 40px;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

.age-calendar-host.jsCalendar thead .jsCalendar-title {
  display: table-cell !important;
  position: relative;
  width: auto !important;
  padding: 10px 40px;
  white-space: nowrap;
  vertical-align: middle;
}

.age-calendar-host.jsCalendar thead .jsCalendar-title-left,
.age-calendar-host.jsCalendar thead .jsCalendar-title-right {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
}

.age-calendar-host.jsCalendar thead .jsCalendar-title-left {
  left: 12px;
}

.age-calendar-host.jsCalendar thead .jsCalendar-title-right {
  right: 12px;
}

.age-calendar-host.jsCalendar thead .jsCalendar-week-days th {
  display: table-cell !important;
  width: calc(100% / 7) !important;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  text-align: center;
  vertical-align: middle;
}

.age-calendar-host.jsCalendar tbody {
  display: table-row-group !important;
  width: auto !important;
}

.age-calendar-host.jsCalendar thead tr,
.age-calendar-host.jsCalendar tbody tr {
  display: table-row !important;
  width: auto !important;
}

.age-calendar-host.jsCalendar tbody td {
  display: table-cell !important;
  box-sizing: border-box;
  width: calc(100% / 7) !important;
  min-width: 0;
  height: 68px !important;
  line-height: 1.1 !important;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  font-family: var(--sans);
  overflow: hidden;
  text-align: center;
  vertical-align: middle;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.age-calendar-host.jsCalendar tbody td:hover {
  transform: translateY(-1px);
}

.age-calendar-host.jsCalendar tbody td.jsCalendar-selected {
  width: calc(100% / 7) !important;
  height: 68px !important;
  border-width: 2px;
  border-color: rgba(79, 70, 229, 0.24);
  background: rgba(79, 70, 229, 0.12);
}

.age-calendar-host.jsCalendar tbody td.jsCalendar-current {
  background: rgba(6, 182, 212, 0.14);
  color: var(--text);
}

.age-calendar-host.jsCalendar tbody td.age-calendar-empty {
  color: transparent;
  pointer-events: none;
}

.age-calendar-host.jsCalendar tbody td.age-calendar-lunar {
  padding: 0;
}

.age-calendar-host.jsCalendar tbody td.age-calendar-lunar-today {
  background: rgba(6, 182, 212, 0.14);
}

.age-calendar-host.jsCalendar tbody td.age-calendar-lunar-selected {
  background: rgba(79, 70, 229, 0.12);
  border: 2px solid rgba(79, 70, 229, 0.24);
}

.age-calendar-cell {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 8px 2px;
}

.age-calendar-day {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
}

.age-calendar-sub {
  display: block;
  max-width: 100%;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text3);
}

.age-calendar-host.jsCalendar tbody td.jsCalendar-selected .age-calendar-sub {
  color: var(--text2);
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > span {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

.field--switch {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 10px;
  background: var(--surface-muted);
  margin-top: 22px;
}

.field--switch span {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

.field--switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--text2);
}

.status-badge.is-neutral {
  background: #eef2f7;
  color: #526072;
}

.status-badge.is-loading {
  background: #e0f2fe;
  color: #0369a1;
}

.status-badge.is-success {
  background: #dcfce7;
  color: #15803d;
}

.status-badge.is-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.message-block {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--text2);
  line-height: 1.7;
}

.is-hidden { display: none; }

.result-card {
  border-radius: 18px;
  padding: 18px 18px;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), transparent 48%),
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.12), transparent 44%),
    var(--surface);
}

.result-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text3);
}

.result-age {
  margin-top: 10px;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.result-detail {
  margin-top: 10px;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.7;
}

.meta-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: transparent;
  border: none;
  padding: 0;
}

.meta-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  padding: 14px 14px;
  backdrop-filter: blur(6px);
}

.meta-label {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

.meta-value {
  margin-top: 8px;
  font-size: 14px;
  font-family: var(--mono);
  color: var(--text);
}

.note-box {
  padding: 14px 14px;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.note-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

.note-text {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text3);
}

@media (max-width: 980px) {
  .age-workspace {
    grid-template-columns: 1fr;
  }
  .age-panel { border-right: none; border-bottom: 1px solid var(--border); }
  .age-side { border-left: none; border-top: 1px solid var(--border); }
  .meta-grid { grid-template-columns: 1fr; }
}
