:root {
  --primary: #E63946;
  --secondary: #457B9D;
  --warning: #f5222d;
  --info: #1890ff;
  --bg: #F8F9FA;
  --card: #FFFFFF;
  --text: #1C1C1E;
  --text-sec: #636366;
  --radius: 16px;
}

body { font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 0; line-height: 1.5; }
.app { max-width: 550px; margin: 0 auto; padding: 16px; }

.auth-badge {
  background: #E1E8ED; color: var(--secondary); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 4px; display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 15px; text-transform: uppercase;
}

header { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 10px; }
.logo { font-size: 18px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }

.hero { margin: 15px 0 25px; }
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.2;
  background: linear-gradient(135deg, var(--primary) 0%, #ff7b54 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 15px;
  color: var(--text-sec);
  margin: 0;
  font-weight: 500;
  line-height: 1.5;
  max-width: 90%;
}

.ad-banner {
  background: linear-gradient(135deg, #fffcf0 0%, #fff5d1 100%);
  border: 1px solid #ffe58f; border-radius: 1px; padding: 1px 16px;
  margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between;
  text-decoration: none; color: #856404; font-size: 13px;
}
.ad-banner b { color: #d46b08; display: block; }

.card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 1px rgba(0,0,0,0.04); margin-bottom: 20px; border: 1px solid #E5E5EA; transition: all 0.3s; }
.card.alert-active { border-color: var(--warning); box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1); }
.card.info-active { border-color: var(--info); box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1); }

.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1px; }
.tax-toggle { display: flex; background: #E5E5EA; padding: 2px; border-radius: 8px; }
.tax-toggle span { padding: 4px 10px; font-size: 11px; cursor: pointer; border-radius: 6px; font-weight: 700; color: var(--text-sec); }
.tax-toggle span.active { background: white; color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

input { width: 100%; border: 2px solid #F2F2F7; border-radius: 1px; padding: 14px; font-size: 32px; font-weight: 800; outline: none; box-sizing: border-box; color: var(--primary); transition: border-color 0.3s; }

.threshold-msg { font-size: 13px; font-weight: 700; margin-top: 8px; display: none; }
.msg-warning { color: var(--warning); }
.msg-info { color: var(--info); }

.seg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.seg-item { border: 1px solid #E5E5EA; padding: 1px; border-radius: 1px; text-align: center; cursor: pointer; transition: all 0.2s; }
.seg-item.active { border-color: var(--primary); background: #FFF5F5; color: var(--primary); }
.seg-item b { display: block; font-size: 14px; margin-bottom: 2px; }
.seg-item small { font-size: 10px; opacity: 0.8; font-weight: 500; }

.res-panel { background: var(--primary); color: white; border-radius: var(--radius); padding: 25px; text-align: center; margin-bottom: 20px; transition: opacity 0.3s; }
.res-panel.dim { opacity: 0.3; filter: grayscale(1); }
.res-val { font-size: 44px; font-weight: 800; margin: 5px 0; letter-spacing: -1px; }
.res-cur { font-size: 14px; opacity: 0.9; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 15px; margin-top: 15px; }

.advice-box { background: rgba(255,255,255,0.15); border-radius: 8px; padding: 10px; margin-top: 15px; font-size: 13px; font-weight: 600; }

.share-stack { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.share-btn { width: 100%; padding: 14px; border-radius: 1px; display: flex; align-items: center; justify-content: center; color: white; cursor: pointer; border: none; font-size: 13px; font-weight: 700; gap: 10px; }
.line { background: #00B900; }
.copy-link { background: #F2F2F7; color: var(--text); border: 1px solid #D1D1D6; }

.seo-box { padding: 20px 10px; border-top: 1px solid #E5E5EA; }
.seo-box h2 { color: var(--text); font-size: 18px; margin-top: 30px; margin-bottom: 1px; font-weight: 800; }
.seo-box p { font-size: 14px; color: var(--text-sec); margin-bottom: 15px; }
.formula-box { background: #F2F2F7; padding: 15px; border-radius: 10px; font-family: monospace; font-size: 13px; margin: 10px 0; color: var(--secondary); }
.authority-link { color: var(--secondary); font-weight: 700; text-decoration: underline; }

.fab-reset { position: fixed; bottom: 30px; right: 20px; background: var(--text); color: white; width: 50px; height: 50px; border-radius: 50%; border: none; box-shadow: 0 4px 1px rgba(0,0,0,0.2); font-size: 20px; cursor: pointer; z-index: 100; }
.authority-module {
  background-color: #f8f9fa;
  border-left: 4px solid #457B9D;
  padding: 1rem 1.5rem;
  margin-top: 2rem;
  border-radius: 0 8px 8px 0;
}
.authority-module h3 {
  color: #1D3557;
  margin-top: 0;
}
.authority-module ul {
  padding-left: 1.2rem;
}
.authority-module a {
  color: #457B9D;
  font-weight: 600;
  text-decoration: none;
}
.authority-module a:hover {
  text-decoration: underline;
  color: #E63946;
}
.authority-module small {
  color: #636366;
  display: block;
  margin-top: 0.5rem;
}
