@charset "UTF-8";

/* ===== Design tokens (aligned with result2) ===== */
:root {
  --shell-bg: #f1f5f9;
  --shell-surface: #ffffff;
  --shell-text: #1e293b;
  --shell-muted: #64748b;
  --shell-border: #e2e8f0;
  --shell-header-from: #0f172a;
  --shell-header-to: #1e293b;
  --shell-accent: #38bdf8;
  --shell-primary: #3b82f6;
  --shell-primary-hover: #2563eb;
  --shell-danger: #ef4444;
  --shell-radius: 12px;
  --shell-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shell-header-h: 56px;
  --shell-cta-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.app-shell {
  margin: 0;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--shell-bg);
  color: var(--shell-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===== Sticky header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--shell-header-from) 0%, var(--shell-header-to) 100%);
  color: #f8fafc;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  min-height: var(--shell-header-h);
}

.app-header__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
}

.app-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-header__nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(203, 213, 225, 0.2);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.app-header__nav a:hover {
  background: rgba(248, 250, 252, 0.1);
  color: #f8fafc;
  border-color: rgba(203, 213, 225, 0.4);
}

/* ===== Page container ===== */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--shell-cta-h) + 24px);
}

.app-panel {
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: var(--shell-radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shell-shadow);
}

.app-panel__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--shell-muted);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

/* ===== Preset / chips ===== */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.preset-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  width: 100%;
  margin-top: 4px;
}

.chip-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--shell-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  cursor: pointer;
}

.chip-hint {
  font-size: 11px;
  color: var(--shell-muted);
  line-height: 1.4;
  margin-top: 4px;
}

/* ===== Accordion ===== */
.acc {
  border: 1px solid var(--shell-border);
  border-radius: var(--shell-radius);
  background: var(--shell-surface);
  margin-bottom: 10px;
  box-shadow: var(--shell-shadow);
  overflow: hidden;
}

.acc__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--shell-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  user-select: none;
  background: #f8fafc;
}

.acc__summary::-webkit-details-marker {
  display: none;
}

.acc__summary::after {
  content: "▾";
  color: var(--shell-muted);
  font-size: 14px;
  transition: transform 0.15s ease;
}

.acc:not([open]) > .acc__summary::after {
  transform: rotate(-90deg);
}

.acc__body {
  padding: 8px 16px 16px;
  border-top: 1px solid var(--shell-border);
}

/* ===== Form fields ===== */
.field {
  margin-bottom: 14px;
}

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--shell-muted);
  margin-bottom: 6px;
  border-left: 3px solid var(--shell-primary);
  padding-left: 8px;
}

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

.field__group {
  margin-bottom: 12px;
}

.field__group-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 8px 8px 0;
  display: inline-block;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  width: 100%;
  max-width: 100%;
}

.check-grid .label_check,
.label_check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-height: 40px;
  font-size: 13px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-height: 40px;
}

input[type="text"],
input[type="password"],
select {
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--shell-text);
  background: #f8fafc;
  min-height: 44px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--shell-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}

.inputs {
  width: 110px;
  max-width: 100%;
}

.inputs2 {
  width: 100%;
  max-width: 360px;
}

.select-wide {
  min-width: 220px;
  max-width: 100%;
}

.select-dev {
  min-width: 160px;
  max-width: 100%;
  font-size: 13px;
}

.range-sep {
  color: var(--shell-muted);
  font-size: 13px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  text-decoration: none;
}

input.btn {
  margin: 0;
}

.btn--primary {
  background: var(--shell-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--shell-primary-hover);
}

.btn--secondary {
  background: #fff;
  color: var(--shell-text);
  border-color: var(--shell-border);
}

.btn--secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn--ghost {
  background: transparent;
  color: var(--shell-muted);
  border-color: var(--shell-border);
  font-size: 12px;
  min-height: 36px;
  padding: 6px 10px;
}

.btn--block {
  width: 100%;
}

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

/* ===== Sticky CTA ===== */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--shell-border);
  backdrop-filter: blur(8px);
  padding: 12px 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
}

.sticky-cta__inner {
  width: 100%;
  max-width: 1100px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.sticky-cta .btn--primary {
  min-width: 160px;
  flex: 1 1 auto;
  max-width: 280px;
}

/* ===== Footer notes ===== */
.app-footer-notes {
  font-size: 12px;
  color: var(--shell-muted);
  margin-top: 8px;
}

.app-footer-notes details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--shell-text);
  margin-bottom: 8px;
}

.app-footer-notes p {
  margin: 0 0 8px;
}

.app-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  padding-bottom: 8px;
}

.app-footer-links a {
  color: var(--shell-primary);
  text-decoration: none;
  font-size: 13px;
}

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

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

.dev-block__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--shell-muted);
}

/* ===== Login page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #0f172a 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--shell-surface);
  border-radius: var(--shell-radius);
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-card__brand {
  text-align: center;
  margin-bottom: 20px;
}

.login-card__brand-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--shell-text);
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.login-card__brand-sub {
  font-size: 13px;
  color: var(--shell-muted);
  margin: 0;
}

.login-card h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}

.login-field {
  margin-bottom: 14px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--shell-muted);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 899px) {
  .app-container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .sticky-cta__inner {
    justify-content: stretch;
  }

  .sticky-cta .btn--secondary {
    flex: 0 0 auto;
  }

  .sticky-cta .btn--primary {
    max-width: none;
  }
}

@media (min-width: 900px) {
  .field--split {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 16px;
    align-items: start;
  }

  .field--split > .field__label {
    margin-bottom: 0;
    padding-top: 10px;
  }
}
